From 32e7eb51854a9230b6f6c9dcb7205dae92ad2fc6 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 15 Dec 2022 18:43:34 +0000 Subject: [PATCH] CodeGen from PR 21878 in Azure/azure-rest-api-specs Merge c7647c4f469312075ec9243d64dff58382cd5fb8 into 038922fd638b28f04ad706a916b486f8392c7cef --- sdk/sql/azure-mgmt-sql/_meta.json | 6 +- .../azure-mgmt-sql/azure/mgmt/sql/__init__.py | 2 +- .../azure/mgmt/sql/_configuration.py | 5 +- .../azure/mgmt/sql/_serialization.py | 93 ++- .../azure/mgmt/sql/_sql_management_client.py | 13 +- .../azure-mgmt-sql/azure/mgmt/sql/_version.py | 2 +- .../azure/mgmt/sql/aio/__init__.py | 2 +- .../mgmt/sql/aio/_sql_management_client.py | 4 +- .../azure/mgmt/sql/aio/operations/__init__.py | 2 +- ...hort_term_retention_policies_operations.py | 108 ++-- .../operations/_capabilities_operations.py | 14 +- .../_data_masking_policies_operations.py | 30 +- .../_data_masking_rules_operations.py | 38 +- ...ta_warehouse_user_activities_operations.py | 32 +- ...d_threat_protection_settings_operations.py | 52 +- .../_database_advisors_operations.py | 44 +- .../_database_automatic_tuning_operations.py | 30 +- ...abase_blob_auditing_policies_operations.py | 56 +- .../_database_columns_operations.py | 50 +- .../_database_extensions_operations.py | 70 +- .../_database_operations_operations.py | 32 +- ...database_recommended_actions_operations.py | 44 +- .../_database_schemas_operations.py | 32 +- ...base_security_alert_policies_operations.py | 52 +- ...ability_assessment_baselines_operations.py | 48 +- ...lity_assessment_execute_scan_operations.py | 32 +- ...ty_assessment_rule_baselines_operations.py | 62 +- ...ility_assessment_scan_result_operations.py | 32 +- ...lnerability_assessment_scans_operations.py | 32 +- ...ability_assessments_settings_operations.py | 32 +- .../operations/_database_tables_operations.py | 32 +- .../operations/_database_usages_operations.py | 18 +- ...ty_assessment_rule_baselines_operations.py | 44 +- ...lnerability_assessment_scans_operations.py | 82 +-- ...se_vulnerability_assessments_operations.py | 66 +- .../aio/operations/_databases_operations.py | 478 ++++++++------ .../operations/_deleted_servers_operations.py | 82 +-- ...tributed_availability_groups_operations.py | 140 ++-- .../_elastic_pool_activities_operations.py | 16 +- ...tic_pool_database_activities_operations.py | 16 +- .../_elastic_pool_operations_operations.py | 32 +- .../operations/_elastic_pools_operations.py | 204 +++--- .../_encryption_protectors_operations.py | 102 +-- .../_endpoint_certificates_operations.py | 32 +- ...abase_blob_auditing_policies_operations.py | 56 +- ...erver_blob_auditing_policies_operations.py | 76 ++- .../operations/_failover_groups_operations.py | 208 +++--- .../operations/_firewall_rules_operations.py | 82 +-- .../_geo_backup_policies_operations.py | 46 +- .../_instance_failover_groups_operations.py | 170 ++--- .../operations/_instance_pools_operations.py | 156 +++-- .../_ipv6_firewall_rules_operations.py | 66 +- .../aio/operations/_job_agents_operations.py | 140 ++-- .../operations/_job_credentials_operations.py | 66 +- .../operations/_job_executions_operations.py | 132 ++-- .../_job_step_executions_operations.py | 32 +- .../aio/operations/_job_steps_operations.py | 98 +-- .../_job_target_executions_operations.py | 50 +- .../_job_target_groups_operations.py | 66 +- .../operations/_job_versions_operations.py | 32 +- .../sql/aio/operations/_jobs_operations.py | 66 +- .../_ledger_digest_uploads_operations.py | 104 +-- ..._long_term_retention_backups_operations.py | 352 +++++----- ...ion_managed_instance_backups_operations.py | 200 +++--- ...long_term_retention_policies_operations.py | 70 +- .../_maintenance_window_options_operations.py | 14 +- .../_maintenance_windows_operations.py | 30 +- ...hort_term_retention_policies_operations.py | 108 ++-- ...d_threat_protection_settings_operations.py | 52 +- .../_managed_database_columns_operations.py | 50 +- ...ged_database_move_operations_operations.py | 32 +- .../_managed_database_queries_operations.py | 32 +- ...commended_sensitivity_labels_operations.py | 16 +- ...ged_database_restore_details_operations.py | 14 +- .../_managed_database_schemas_operations.py | 32 +- ...base_security_alert_policies_operations.py | 52 +- ...ged_database_security_events_operations.py | 18 +- ..._database_sensitivity_labels_operations.py | 136 ++-- .../_managed_database_tables_operations.py | 32 +- ..._transparent_data_encryption_operations.py | 52 +- ...ty_assessment_rule_baselines_operations.py | 44 +- ...lnerability_assessment_scans_operations.py | 82 +-- ...se_vulnerability_assessments_operations.py | 66 +- .../_managed_databases_operations.py | 302 +++++---- ...aged_instance_administrators_operations.py | 102 +-- ...d_threat_protection_settings_operations.py | 70 +- ...zure_ad_only_authentications_operations.py | 102 +-- .../_managed_instance_dtcs_operations.py | 70 +- ...stance_encryption_protectors_operations.py | 102 +-- .../_managed_instance_keys_operations.py | 102 +-- ...long_term_retention_policies_operations.py | 70 +- ..._managed_instance_operations_operations.py | 46 +- ...private_endpoint_connections_operations.py | 102 +-- ...tance_private_link_resources_operations.py | 32 +- ...ed_instance_tde_certificates_operations.py | 36 +- ...ce_vulnerability_assessments_operations.py | 66 +- .../_managed_instances_operations.py | 224 ++++--- ...hort_term_retention_policies_operations.py | 108 ++-- .../_managed_server_dns_aliases_operations.py | 140 ++-- ...rver_security_alert_policies_operations.py | 70 +- .../mgmt/sql/aio/operations/_operations.py | 16 +- .../_outbound_firewall_rules_operations.py | 102 +-- ...private_endpoint_connections_operations.py | 102 +-- .../_private_link_resources_operations.py | 32 +- ...commended_sensitivity_labels_operations.py | 16 +- .../_recoverable_databases_operations.py | 28 +- ...ecoverable_managed_databases_operations.py | 32 +- .../_replication_links_operations.py | 150 +++-- ...restorable_dropped_databases_operations.py | 32 +- ...le_dropped_managed_databases_operations.py | 32 +- .../operations/_restore_points_operations.py | 84 +-- .../_sensitivity_labels_operations.py | 136 ++-- ...d_threat_protection_settings_operations.py | 70 +- .../operations/_server_advisors_operations.py | 44 +- .../_server_automatic_tuning_operations.py | 30 +- ...rver_azure_ad_administrators_operations.py | 102 +-- ...zure_ad_only_authentications_operations.py | 102 +-- ...erver_blob_auditing_policies_operations.py | 76 ++- .../_server_communication_links_operations.py | 74 ++- .../_server_connection_policies_operations.py | 70 +- ...erver_dev_ops_audit_settings_operations.py | 72 ++- .../_server_dns_aliases_operations.py | 136 ++-- .../aio/operations/_server_keys_operations.py | 102 +-- .../_server_operations_operations.py | 18 +- ...rver_security_alert_policies_operations.py | 70 +- .../_server_trust_certificates_operations.py | 102 +-- .../_server_trust_groups_operations.py | 120 ++-- .../operations/_server_usages_operations.py | 16 +- ...er_vulnerability_assessments_operations.py | 66 +- .../sql/aio/operations/_servers_operations.py | 210 +++--- .../_service_objectives_operations.py | 28 +- .../aio/operations/_sql_agent_operations.py | 30 +- ...rability_assessment_baseline_operations.py | 40 +- ...ability_assessment_baselines_operations.py | 20 +- ...lity_assessment_execute_scan_operations.py | 40 +- ...ity_assessment_rule_baseline_operations.py | 60 +- ...ty_assessment_rule_baselines_operations.py | 18 +- ...ility_assessment_scan_result_operations.py | 40 +- ...lnerability_assessment_scans_operations.py | 40 +- ...ql_vulnerability_assessments_operations.py | 14 +- ...ability_assessments_settings_operations.py | 52 +- .../_subscription_usages_operations.py | 32 +- .../_synapse_link_workspaces_operations.py | 18 +- .../aio/operations/_sync_agents_operations.py | 134 ++-- .../aio/operations/_sync_groups_operations.py | 254 ++++---- .../operations/_sync_members_operations.py | 190 +++--- .../_tde_certificates_operations.py | 36 +- .../aio/operations/_time_zones_operations.py | 32 +- ...transparent_data_encryptions_operations.py | 48 +- .../sql/aio/operations/_usages_operations.py | 18 +- .../_virtual_clusters_operations.py | 152 +++-- .../_virtual_network_rules_operations.py | 102 +-- .../_workload_classifiers_operations.py | 102 +-- .../operations/_workload_groups_operations.py | 102 +-- .../azure/mgmt/sql/models/__init__.py | 4 +- .../azure/mgmt/sql/models/_models_py3.py | 18 + .../models/_sql_management_client_enums.py | 7 + .../azure/mgmt/sql/operations/__init__.py | 2 +- ...hort_term_retention_policies_operations.py | 136 ++-- .../operations/_capabilities_operations.py | 20 +- .../_data_masking_policies_operations.py | 44 +- .../_data_masking_rules_operations.py | 52 +- ...ta_warehouse_user_activities_operations.py | 44 +- ...d_threat_protection_settings_operations.py | 72 ++- .../_database_advisors_operations.py | 64 +- .../_database_automatic_tuning_operations.py | 44 +- ...abase_blob_auditing_policies_operations.py | 80 +-- .../_database_columns_operations.py | 68 +- .../_database_extensions_operations.py | 90 +-- .../_database_operations_operations.py | 44 +- ...database_recommended_actions_operations.py | 64 +- .../_database_schemas_operations.py | 44 +- ...base_security_alert_policies_operations.py | 72 ++- ...ability_assessment_baselines_operations.py | 68 +- ...lity_assessment_execute_scan_operations.py | 38 +- ...ty_assessment_rule_baselines_operations.py | 88 +-- ...ility_assessment_scan_result_operations.py | 44 +- ...lnerability_assessment_scans_operations.py | 44 +- ...ability_assessments_settings_operations.py | 44 +- .../operations/_database_tables_operations.py | 44 +- .../operations/_database_usages_operations.py | 24 +- ...ty_assessment_rule_baselines_operations.py | 64 +- ...lnerability_assessment_scans_operations.py | 106 +-- ...se_vulnerability_assessments_operations.py | 92 +-- .../sql/operations/_databases_operations.py | 608 ++++++++++-------- .../operations/_deleted_servers_operations.py | 106 +-- ...tributed_availability_groups_operations.py | 174 ++--- .../_elastic_pool_activities_operations.py | 20 +- ...tic_pool_database_activities_operations.py | 20 +- .../_elastic_pool_operations_operations.py | 44 +- .../operations/_elastic_pools_operations.py | 252 ++++---- .../_encryption_protectors_operations.py | 128 ++-- .../_endpoint_certificates_operations.py | 44 +- ...abase_blob_auditing_policies_operations.py | 80 +-- ...erver_blob_auditing_policies_operations.py | 100 +-- .../operations/_failover_groups_operations.py | 254 ++++---- .../operations/_firewall_rules_operations.py | 116 ++-- .../_geo_backup_policies_operations.py | 60 +- .../_instance_failover_groups_operations.py | 208 +++--- .../operations/_instance_pools_operations.py | 196 +++--- .../_ipv6_firewall_rules_operations.py | 92 +-- .../sql/operations/_job_agents_operations.py | 174 ++--- .../operations/_job_credentials_operations.py | 92 +-- .../operations/_job_executions_operations.py | 168 ++--- .../_job_step_executions_operations.py | 44 +- .../sql/operations/_job_steps_operations.py | 136 ++-- .../_job_target_executions_operations.py | 68 +- .../_job_target_groups_operations.py | 92 +-- .../operations/_job_versions_operations.py | 44 +- .../mgmt/sql/operations/_jobs_operations.py | 92 +-- .../_ledger_digest_uploads_operations.py | 130 ++-- ..._long_term_retention_backups_operations.py | 444 +++++++------ ...ion_managed_instance_backups_operations.py | 260 ++++---- ...long_term_retention_policies_operations.py | 90 +-- .../_maintenance_window_options_operations.py | 20 +- .../_maintenance_windows_operations.py | 44 +- ...hort_term_retention_policies_operations.py | 136 ++-- ...d_threat_protection_settings_operations.py | 72 ++- .../_managed_database_columns_operations.py | 68 +- ...ged_database_move_operations_operations.py | 44 +- .../_managed_database_queries_operations.py | 44 +- ...commended_sensitivity_labels_operations.py | 24 +- ...ged_database_restore_details_operations.py | 20 +- .../_managed_database_schemas_operations.py | 44 +- ...base_security_alert_policies_operations.py | 72 ++- ...ged_database_security_events_operations.py | 24 +- ..._database_sensitivity_labels_operations.py | 196 +++--- .../_managed_database_tables_operations.py | 44 +- ..._transparent_data_encryption_operations.py | 72 ++- ...ty_assessment_rule_baselines_operations.py | 64 +- ...lnerability_assessment_scans_operations.py | 106 +-- ...se_vulnerability_assessments_operations.py | 92 +-- .../_managed_databases_operations.py | 374 ++++++----- ...aged_instance_administrators_operations.py | 128 ++-- ...d_threat_protection_settings_operations.py | 90 +-- ...zure_ad_only_authentications_operations.py | 128 ++-- .../_managed_instance_dtcs_operations.py | 90 +-- ...stance_encryption_protectors_operations.py | 128 ++-- .../_managed_instance_keys_operations.py | 128 ++-- ...long_term_retention_policies_operations.py | 90 +-- ..._managed_instance_operations_operations.py | 64 +- ...private_endpoint_connections_operations.py | 128 ++-- ...tance_private_link_resources_operations.py | 44 +- ...ed_instance_tde_certificates_operations.py | 44 +- ...ce_vulnerability_assessments_operations.py | 92 +-- .../_managed_instances_operations.py | 282 ++++---- ...hort_term_retention_policies_operations.py | 136 ++-- .../_managed_server_dns_aliases_operations.py | 174 ++--- ...rver_security_alert_policies_operations.py | 90 +-- .../azure/mgmt/sql/operations/_operations.py | 20 +- .../_outbound_firewall_rules_operations.py | 128 ++-- ...private_endpoint_connections_operations.py | 128 ++-- .../_private_link_resources_operations.py | 44 +- ...commended_sensitivity_labels_operations.py | 24 +- .../_recoverable_databases_operations.py | 36 +- ...ecoverable_managed_databases_operations.py | 44 +- .../_replication_links_operations.py | 186 +++--- ...restorable_dropped_databases_operations.py | 44 +- ...le_dropped_managed_databases_operations.py | 44 +- .../operations/_restore_points_operations.py | 110 ++-- .../_sensitivity_labels_operations.py | 196 +++--- ...d_threat_protection_settings_operations.py | 90 +-- .../operations/_server_advisors_operations.py | 64 +- .../_server_automatic_tuning_operations.py | 44 +- ...rver_azure_ad_administrators_operations.py | 128 ++-- ...zure_ad_only_authentications_operations.py | 128 ++-- ...erver_blob_auditing_policies_operations.py | 100 +-- .../_server_communication_links_operations.py | 92 +-- .../_server_connection_policies_operations.py | 90 +-- ...erver_dev_ops_audit_settings_operations.py | 92 +-- .../_server_dns_aliases_operations.py | 168 ++--- .../sql/operations/_server_keys_operations.py | 128 ++-- .../_server_operations_operations.py | 24 +- ...rver_security_alert_policies_operations.py | 90 +-- .../_server_trust_certificates_operations.py | 128 ++-- .../_server_trust_groups_operations.py | 152 +++-- .../operations/_server_usages_operations.py | 20 +- ...er_vulnerability_assessments_operations.py | 92 +-- .../sql/operations/_servers_operations.py | 266 ++++---- .../_service_objectives_operations.py | 36 +- .../sql/operations/_sql_agent_operations.py | 44 +- ...rability_assessment_baseline_operations.py | 60 +- ...ability_assessment_baselines_operations.py | 32 +- ...lity_assessment_execute_scan_operations.py | 50 +- ...ity_assessment_rule_baseline_operations.py | 92 +-- ...ty_assessment_rule_baselines_operations.py | 28 +- ...ility_assessment_scan_result_operations.py | 60 +- ...lnerability_assessment_scans_operations.py | 60 +- ...ql_vulnerability_assessments_operations.py | 20 +- ...ability_assessments_settings_operations.py | 72 ++- .../_subscription_usages_operations.py | 44 +- .../_synapse_link_workspaces_operations.py | 24 +- .../sql/operations/_sync_agents_operations.py | 172 ++--- .../sql/operations/_sync_groups_operations.py | 324 +++++----- .../operations/_sync_members_operations.py | 236 ++++--- .../_tde_certificates_operations.py | 44 +- .../sql/operations/_time_zones_operations.py | 44 +- ...transparent_data_encryptions_operations.py | 68 +- .../mgmt/sql/operations/_usages_operations.py | 24 +- .../_virtual_clusters_operations.py | 190 +++--- .../_virtual_network_rules_operations.py | 128 ++-- .../_workload_classifiers_operations.py | 128 ++-- .../operations/_workload_groups_operations.py | 128 ++-- .....py => administrator_create_or_update.py} | 2 +- ...inistrator..py => administrator_delete.py} | 2 +- ...administrator..py => administrator_get.py} | 2 +- ...dministrator..py => administrator_list.py} | 2 +- .../azure_ad_only_auth_create_or_update.py | 43 ++ .../azure_ad_only_auth_delete.py | 42 ++ .../azure_ad_only_auth_get.py | 42 ++ .../azure_ad_only_auth_list.py | 42 ++ ...ration.py => cancel_database_operation.py} | 2 +- ...on.py => cancel_elastic_pool_operation.py} | 2 +- ..._execution..py => cancel_job_execution.py} | 2 +- ...y => cancel_managed_instance_operation.py} | 2 +- ...ame_availability_server_already_exists.py} | 2 +- ...eck_name_availability_server_available.py} | 2 +- ...check_name_availability_server_invalid.py} | 2 +- ...=> column_sensitivity_label_create_max.py} | 2 +- ....py => column_sensitivity_label_delete.py} | 2 +- ...umn.py => column_sensitivity_label_get.py} | 2 +- ...mns.py => columns_list_by_database_max.py} | 2 +- ...mns.py => columns_list_by_database_min.py} | 2 +- ...e_configured_backup_storage_redundancy.py} | 4 +- ..._copy..py => create_database_copy_mode.py} | 4 +- .../create_database_default_enclave.py | 43 ++ ...de..py => create_database_default_mode.py} | 4 +- ...edger_on..py => create_database_ledger.py} | 4 +- ...ate_database_maintenance_configuration.py} | 4 +- ..._parameters..py => create_database_min.py} | 4 +- ...y..py => create_database_named_replica.py} | 4 +- ...store..py => create_database_pitr_mode.py} | 4 +- .....py => create_database_secondary_mode.py} | 4 +- ...ry..py => create_database_standby_mode.py} | 4 +- .../create_database_vbs_enclave.py | 43 ++ ...te_dw_database_cross_subscription_pitr.py} | 4 +- ...w_database_cross_subscription_recovery.py} | 4 +- ...dw_database_cross_subscription_restore.py} | 4 +- ..._execution..py => create_job_execution.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 +- ...agent.py => create_or_update_job_agent.py} | 2 +- ....py => create_or_update_job_credential.py} | 2 +- .....py => create_or_update_job_execution.py} | 2 +- ...ecified.py => create_or_update_job_max.py} | 2 +- ...d..py => create_or_update_job_step_max.py} | 2 +- ...d..py => create_or_update_job_step_min.py} | 2 +- ... 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 +- ...eate_or_update_workload_classifier_max.py} | 2 +- ...eate_or_update_workload_classifier_min.py} | 2 +- .../create_or_update_workload_group_max.py | 53 ++ .../create_or_update_workload_group_min.py | 46 ++ ...te_vcore_database_by_service_objective.py} | 4 +- ...te_vcore_database_by_sku_name_capacity.py} | 4 +- ...ta_masking_policy_create_or_update_max.py} | 2 +- ...ta_masking_policy_create_or_update_min.py} | 2 +- ...g_policy.py => data_masking_policy_get.py} | 2 +- ...king_rule_create_or_update_default_max.py} | 2 +- ...king_rule_create_or_update_default_min.py} | 2 +- ...a_masking_rule_create_or_update_number.py} | 2 +- ...ata_masking_rule_create_or_update_text.py} | 2 +- ...ing_rules.py => data_masking_rule_list.py} | 2 +- ...y => data_warehouse_restore_points_get.py} | 2 +- ...ehouse_restore_points_list_by_database.py} | 2 +- ..._threat_protection_settings_create_max.py} | 2 +- ..._threat_protection_settings_create_min.py} | 2 +- ...dvanced_threat_protection_settings_get.py} | 2 +- ...t_protection_settings_list_by_database.py} | 2 +- ...ase_advisor.py => database_advisor_get.py} | 2 +- ...e_advisors.py => database_advisor_list.py} | 2 +- ..._advisor.py => database_advisor_update.py} | 2 +- ....py => database_auditing_settings_list.py} | 2 +- ...gs.py => database_automatic_tuning_get.py} | 2 +- ...> database_automatic_tuning_update_max.py} | 2 +- ...> database_automatic_tuning_update_min.py} | 2 +- ...base_azure_monitor_auditing_create_min.py} | 2 +- ...y => database_blob_auditing_create_max.py} | 2 +- ...y => database_blob_auditing_create_min.py} | 2 +- ...olicy.py => database_blob_auditing_get.py} | 2 +- ...abase_column.py => database_column_get.py} | 2 +- .../database_column_list_by_table.py | 45 ++ ...tabase_extended_auditing_settings_list.py} | 2 +- .../database_metrics_definitions_list.py | 43 ++ ...y => database_metrics_list_with_filter.py} | 2 +- ....py => database_recommended_action_get.py} | 2 +- ...py => database_recommended_action_list.py} | 2 +- ...atabase_recommended_action_list_expand.py} | 2 +- ... => database_recommended_action_update.py} | 2 +- .....py => database_restore_points_delete.py} | 2 +- ...int..py => database_restore_points_get.py} | 2 +- ...tabase_restore_points_list_by_database.py} | 2 +- ...nt..py => database_restore_points_post.py} | 2 +- ...abase_schema.py => database_schema_get.py} | 2 +- ...py => database_schema_list_by_database.py} | 2 +- ... => database_security_alert_create_max.py} | 2 +- ... => database_security_alert_create_min.py} | 2 +- ...licy.py => database_security_alert_get.py} | 2 +- ...tabase_security_alert_list_by_database.py} | 2 +- ..._vulnerability_assessment_baseline_add.py} | 2 +- ...ability_assessment_baseline_add_latest.py} | 2 +- ...l_vulnerability_assessment_baseline_get.py | 44 ++ ...e_list_by_sql_vulnerability_assessment.py} | 2 +- ...abase_sql_vulnerability_assessment_get.py} | 2 +- ...nerability_assessment_list_by_database.py} | 2 +- ...rability_assessment_list_scans_results.py} | 2 +- ...ability_assessment_rule_baseline_create.py | 51 ++ ...ability_assessment_rule_baseline_delete.py | 45 ++ ...erability_assessment_rule_baseline_get.py} | 2 +- ...sessment_rule_baseline_list_by_baseline.py | 45 ++ ...base_sql_vulnerability_assessment_scan.py} | 2 +- ...ssessment_scan_records_list_by_database.py | 44 ++ ..._vulnerability_assessment_scans_execute.py | 43 ++ ...vulnerability_assessment_scans_results.py} | 2 +- ...atabase_table.py => database_table_get.py} | 2 +- ...es.py => database_table_list_by_schema.py} | 2 +- ...ssessment_create_container_sas_key_min.py} | 2 +- ...se_vulnerability_assessment_create_max.py} | 2 +- ...sessment_create_storage_access_key_min.py} | 2 +- ...tabase_vulnerability_assessment_delete.py} | 2 +- ... database_vulnerability_assessment_get.py} | 2 +- ...nerability_assessment_list_by_database.py} | 2 +- ...bility_assessment_rule_baseline_create.py} | 2 +- ...bility_assessment_rule_baseline_delete.py} | 2 +- ...erability_assessment_rule_baseline_get.py} | 2 +- ...e_vulnerability_assessment_scan_export.py} | 2 +- ...nerability_assessment_scan_records_get.py} | 2 +- ...sessment_scan_records_list_by_database.py} | 2 +- ...vulnerability_assessment_scans_execute.py} | 2 +- ...etes_a_database..py => delete_database.py} | 4 +- ...stance_pool.py => delete_instance_pool.py} | 2 +- .../{delete_a_job.py => delete_job.py} | 2 +- ...ete_a_job_agent.py => delete_job_agent.py} | 2 +- ...credential.py => delete_job_credential.py} | 2 +- ...lete_a_job_step..py => delete_job_step.py} | 2 +- ...t_group..py => delete_job_target_group.py} | 2 +- ...ifier.py => delete_workload_classifier.py} | 2 +- ...load_group.py => delete_workload_group.py} | 2 +- ...eleted_server.py => deleted_server_get.py} | 2 +- ...eted_servers.py => deleted_server_list.py} | 2 +- ...=> deleted_server_list_by_subscription.py} | 2 +- ...d_server..py => deleted_server_recover.py} | 2 +- ...distributed_availability_groups_create.py} | 2 +- ...distributed_availability_groups_delete.py} | 2 +- ...=> distributed_availability_groups_get.py} | 2 +- ...d_availability_groups_list_by_instance.py} | 2 +- ...distributed_availability_groups_update.py} | 2 +- ...ivity.py => elastic_pool_activity_list.py} | 2 +- ...y => elastic_pool_create_or_update_max.py} | 2 +- ...y => elastic_pool_create_or_update_min.py} | 2 +- ...r_update_set_maintenance_configuration.py} | 2 +- ...=> elastic_pool_database_activity_list.py} | 2 +- ...elastic_pool.py => elastic_pool_delete.py} | 2 +- ...an_elastic_pool.py => elastic_pool_get.py} | 2 +- ...rver.py => elastic_pool_list_by_server.py} | 2 +- .../elastic_pool_metrics_definitions_list.py | 43 ++ .../elastic_pool_metrics_list_with_filter.py | 44 ++ ...pdate_assign_maintenance_configuration.py} | 2 +- ...arameter.py => elastic_pool_update_max.py} | 2 +- ...update_reset_maintenance_configuration.py} | 2 +- ...n_protector_create_or_update_key_vault.py} | 2 +- ...ector_create_or_update_service_managed.py} | 2 +- ...otector.py => encryption_protector_get.py} | 2 +- ...server.py => encryption_protector_list.py} | 2 +- ....py => encryption_protector_revalidate.py} | 2 +- ...icate..py => endpoint_certificates_get.py} | 2 +- ...endpoint_certificates_list_by_instance.py} | 2 +- ...orts_a_database..py => export_database.py} | 4 +- ...export_database_with_network_isolation.py} | 4 +- ...base_azure_monitor_auditing_create_min.py} | 2 +- ...nded_database_blob_auditing_create_max.py} | 2 +- ...nded_database_blob_auditing_create_min.py} | 2 +- ...=> extended_database_blob_auditing_get.py} | 2 +- ...tended_server_blob_auditing_create_max.py} | 2 +- ...tended_server_blob_auditing_create_min.py} | 2 +- ...y => extended_server_blob_auditing_get.py} | 2 +- ...er_an_database.py => failover_database.py} | 4 +- ...astic_pool.py => failover_elastic_pool.py} | 2 +- ....py => failover_group_create_or_update.py} | 2 +- ...over_group.py => failover_group_delete.py} | 2 +- ...er_group.py => failover_group_failover.py} | 2 +- ...r_group_force_failover_allow_data_loss.py} | 2 +- ...ailover_group.py => failover_group_get.py} | 2 +- ...ilover_group.py => failover_group_list.py} | 2 +- ...over_group.py => failover_group_update.py} | 2 +- ...tance..py => failover_managed_instance.py} | 2 +- .../min.py => firewall_rule_create.py} | 2 +- ...rewall_rule.py => firewall_rule_delete.py} | 2 +- ..._firewall_rule.py => firewall_rule_get.py} | 2 +- ...irewall_rules.py => firewall_rule_list.py} | 2 +- ...wall_rules.py => firewall_rule_replace.py} | 2 +- .../min.py => firewall_rule_update.py} | 2 +- ...> geo_backup_policies_create_or_update.py} | 2 +- ...p_policy.py => geo_backup_policies_get.py} | 2 +- ...olicies.py => geo_backup_policies_list.py} | 2 +- ... => get_data_warehouse_user_activities.py} | 2 +- ...ensions..py => get_database_extensions.py} | 2 +- ...base_usages..py => get_database_usages.py} | 2 +- ..._instance_pool.py => get_instance_pool.py} | 2 +- .../{get_a_job.py => get_job.py} | 2 +- .../{get_a_job_agent.py => get_job_agent.py} | 2 +- ..._a_credential.py => get_job_credential.py} | 2 +- ...job_execution..py => get_job_execution.py} | 2 +- ...execution.py => get_job_execution_step.py} | 2 +- ...ecution.py => get_job_execution_target.py} | 2 +- ..._a_job_step..py => get_job_step_by_job.py} | 2 +- ...ob_step..py => get_job_step_by_version.py} | 2 +- ...rget_group..py => get_job_target_group.py} | 2 +- ...ersion_of_a_job..py => get_job_version.py} | 2 +- ...st_managed_short_term_retention_policy.py} | 2 +- ...erm_retention_policy_restorable_dropped.py | 43 ++ .....py => get_maintenance_window_options.py} | 2 +- ...atabase..py => get_maintenance_windows.py} | 2 +- ...n.py => get_managed_instance_operation.py} | 2 +- ...et_managed_short_term_retention_policy.py} | 2 +- ...erm_retention_policy_restorable_dropped.py | 43 ++ ...py => get_recoverable_managed_database.py} | 2 +- ....py => get_restorable_dropped_database.py} | 2 +- ...et_restorable_dropped_managed_database.py} | 2 +- .../get_short_term_retention_policy.py | 43 ++ ...s_a_database..py => get_vcore_database.py} | 4 +- .../get_vcore_database_default_enclave.py | 42 ++ .../get_vcore_database_vbs_enclave.py | 42 ++ ...arehouse.py => get_workload_classifier.py} | 2 +- ...oup.py => get_workload_classifier_list.py} | 2 +- ...ata_warehouse.py => get_workload_group.py} | 2 +- ...arehouse.py => get_workload_group_list.py} | 2 +- ...te_set_high_availability_replica_count.py} | 2 +- ...pool.py => hyperscale_elastic_pool_get.py} | 2 +- ...te_set_high_availability_replica_count.py} | 2 +- ..._empty_database..py => import_database.py} | 4 +- ...import_database_with_network_isolation.py} | 4 +- ...ew_database..py => import_new_database.py} | 2 +- ...rt_new_database_with_network_isolation.py} | 2 +- ...aged_database_list_by_managed_instance.py} | 2 +- ...nstance_failover_group_create_or_update.py | 55 ++ .../instance_failover_group_delete.py | 42 ++ .../instance_failover_group_failover.py | 42 ++ ...er_group_force_failover_allow_data_loss.py | 42 ++ .../instance_failover_group_get.py | 42 ++ .../instance_failover_group_list.py | 42 ++ .../min.py => ipv6_firewall_rule_create.py} | 2 +- ...l_rule.py => ipv6_firewall_rule_delete.py} | 2 +- ...wall_rule.py => ipv6_firewall_rule_get.py} | 2 +- ...ll_rules.py => ipv6_firewall_rule_list.py} | 2 +- .../min.py => ipv6_firewall_rule_update.py} | 2 +- ...se.py => ledger_digest_uploads_disable.py} | 2 +- ...ase.py => ledger_digest_uploads_enable.py} | 2 +- ...abase..py => ledger_digest_uploads_get.py} | 2 +- ...base..py => ledger_digest_uploads_list.py} | 2 +- ...=> list_data_warehouse_user_activities.py} | 2 +- ...nsions..py => list_database_extensions.py} | 2 +- ...rations.py => list_database_operations.py} | 2 +- .....py => list_databases_by_elastic_pool.py} | 4 +- ...ons.py => list_elastic_pool_operations.py} | 2 +- ...usages..py => list_instance_pool_usage.py} | 2 +- ...y => list_instance_pool_usage_expanded.py} | 2 +- ...list_instance_pools_by_subscription_id.py} | 2 +- ...server.py => list_job_agents_by_server.py} | 2 +- ...nt.py => list_job_credentials_by_agent.py} | 2 +- ...cutions.py => list_job_execution_steps.py} | 2 +- ...ist_job_execution_targets_by_execution.py} | 2 +- .../list_job_execution_targets_by_step.py | 46 ++ ...nt..py => list_job_executions_by_agent.py} | 2 +- ...st_job_executions_by_agent_with_filter.py} | 2 +- ...ions..py => list_job_executions_by_job.py} | 2 +- ..._of_a_job..py => list_job_steps_by_job.py} | 2 +- ...a_job..py => list_job_steps_by_version.py} | 2 +- ...an_agent..py => list_job_target_groups.py} | 2 +- ...ions_of_a_job..py => list_job_versions.py} | 2 +- ...n_a_job_agent.py => list_jobs_by_agent.py} | 2 +- ...py => list_managed_instance_operations.py} | 2 +- ...ecoverable_managed_databases_by_server.py} | 2 +- ...restorable_dropped_databases_by_server.py} | 2 +- ...perations.py => list_server_operations.py} | 2 +- ...ort_term_retention_policies_by_database.py | 43 ++ .....py => list_vcore_databases_by_server.py} | 4 +- ..._vcore_databases_enclave_type_by_server.py | 42 ++ ...vcore_inaccessible_databases_by_server.py} | 4 +- ...> location_capability_list_by_location.py} | 2 +- ....py => long_term_retention_backup_copy.py} | 2 +- ...y => long_term_retention_backup_delete.py} | 2 +- .....py => long_term_retention_backup_get.py} | 2 +- ...term_retention_backup_list_by_database.py} | 2 +- ...term_retention_backup_list_by_location.py} | 2 +- ...g_term_retention_backup_list_by_server.py} | 2 +- ...y => long_term_retention_backup_update.py} | 2 +- ...term_retention_policy_create_or_update.py} | 2 +- .....py => long_term_retention_policy_get.py} | 2 +- ..._term_retention_policy_list_by_database.py | 43 ++ ...> managed_columns_list_by_database_max.py} | 2 +- ...> managed_columns_list_by_database_min.py} | 2 +- ..._threat_protection_settings_create_max.py} | 2 +- ..._threat_protection_settings_create_min.py} | 2 +- ...dvanced_threat_protection_settings_get.py} | 2 +- ...t_protection_settings_list_by_database.py} | 2 +- ...ve..py => managed_database_cancel_move.py} | 2 +- ...lumn.py => managed_database_column_get.py} | 2 +- .../managed_database_column_list_by_table.py | 45 ++ ...tabase_column_sensitivity_label_create.py} | 2 +- ...tabase_column_sensitivity_label_delete.py} | 2 +- ..._database_column_sensitivity_label_get.py} | 2 +- ...ged_database_complete_external_restore.py} | 2 +- .....py => managed_database_complete_move.py} | 2 +- ...ties.py => managed_database_create_max.py} | 2 +- ...ties.py => managed_database_create_min.py} | 2 +- ..._database_create_point_in_time_restore.py} | 2 +- ...py => managed_database_create_recovery.py} | 2 +- ...atabase_create_restore_external_backup.py} | 2 +- ...store_external_backup_managed_identity.py} | 2 +- ...ged_database_create_restore_ltr_backup.py} | 2 +- ...database.py => managed_database_delete.py} | 2 +- ...ed_database.py => managed_database_get.py} | 2 +- ...aged_database_list_by_managed_instance.py} | 2 +- ...ged_database_move_operation_result_get.py} | 2 +- ...ed_database_move_operation_result_list.py} | 2 +- ..._operation_result_list_last_operations.py} | 2 +- ...atabase_move_operation_result_list_max.py} | 2 +- ...ended_column_sensitivity_label_disable.py} | 2 +- ...mended_column_sensitivity_label_enable.py} | 2 +- ...py => managed_database_restore_details.py} | 2 +- ...hema.py => managed_database_schema_get.py} | 2 +- ...naged_database_schema_list_by_database.py} | 2 +- ...aged_database_security_alert_create_max.py | 54 ++ ...aged_database_security_alert_create_min.py | 44 ++ .../managed_database_security_alert_get.py | 43 ++ ...tabase_security_alert_list_by_database.py} | 2 +- ...naged_database_security_events_get_max.py} | 2 +- ...naged_database_security_events_get_min.py} | 2 +- ...base_sensitivity_labels_current_update.py} | 2 +- ...tivity_labels_list_by_database_current.py} | 2 +- ...ty_labels_list_by_database_recommended.py} | 2 +- ..._sensitivity_labels_recommended_update.py} | 2 +- ....py => managed_database_start_move_max.py} | 2 +- ....py => managed_database_start_move_min.py} | 2 +- ...table.py => managed_database_table_get.py} | 2 +- ... managed_database_table_list_by_schema.py} | 2 +- ...ties.py => managed_database_update_max.py} | 2 +- ...ties.py => managed_database_update_min.py} | 2 +- ...ase_vulnerability_assessment_create_max.py | 54 ++ ...se_vulnerability_assessment_create_min.py} | 2 +- ...atabase_vulnerability_assessment_delete.py | 43 ++ ...d_database_vulnerability_assessment_get.py | 43 ++ ...nerability_assessment_list_by_database.py} | 2 +- ...ability_assessment_rule_baseline_create.py | 54 ++ ...ability_assessment_rule_baseline_delete.py | 45 ++ ...nerability_assessment_rule_baseline_get.py | 45 ++ ...se_vulnerability_assessment_scan_export.py | 44 ++ ...lnerability_assessment_scan_records_get.py | 44 ++ ...ssessment_scan_records_list_by_database.py | 44 ++ ..._vulnerability_assessment_scans_execute.py | 44 ++ ... managed_instance_administrator_create.py} | 2 +- ... managed_instance_administrator_delete.py} | 2 +- ... => managed_instance_administrator_get.py} | 2 +- ...nstance_administrator_list_by_instance.py} | 2 +- ... managed_instance_administrator_update.py} | 2 +- ..._threat_protection_settings_create_max.py} | 2 +- ..._threat_protection_settings_create_min.py} | 2 +- ...dvanced_threat_protection_settings_get.py} | 2 +- ...t_protection_settings_list_by_instance.py} | 2 +- ...ce_azure_ad_only_auth_create_or_update.py} | 2 +- ...ged_instance_azure_ad_only_auth_delete.py} | 2 +- ...anaged_instance_azure_ad_only_auth_get.py} | 2 +- ...ce_azure_ad_only_auth_list_by_instance.py} | 2 +- ...ties.py => managed_instance_create_max.py} | 2 +- ...ties.py => managed_instance_create_min.py} | 2 +- ...instance.py => managed_instance_delete.py} | 2 +- ...ttings..py => managed_instance_dtc_get.py} | 2 +- ...tings..py => managed_instance_dtc_list.py} | 2 +- ...managed_instance_dtc_update_enable_dtc.py} | 2 +- ....py => managed_instance_dtc_update_max.py} | 2 +- ...on_protector_create_or_update_key_vault.py | 49 ++ ...tector_create_or_update_service_managed.py | 43 ++ ...naged_instance_encryption_protector_get.py | 42 ++ ...ged_instance_encryption_protector_list.py} | 2 +- ...nstance_encryption_protector_revalidate.py | 42 ++ ...ed_instance.py => managed_instance_get.py} | 2 +- ..._get_with_expand_equals_administrators.py} | 2 +- ... managed_instance_key_create_or_update.py} | 2 +- ..._key.py => managed_instance_key_delete.py} | 2 +- ...nce_key.py => managed_instance_key_get.py} | 2 +- ...tance..py => managed_instance_key_list.py} | 2 +- ..._instances.py => managed_instance_list.py} | 2 +- ...managed_instance_list_by_instance_pool.py} | 2 +- ...pool_with_expand_equals_administrators.py} | 2 +- ...anaged_instance_list_by_resource_group.py} | 2 +- ...roup_with_expand_equals_administrators.py} | 2 +- ...list_with_expand_equals_administrators.py} | 2 +- ...tance_long_term_retention_backup_delete.py | 43 ++ ...nstance_long_term_retention_backup_get.py} | 2 +- ..._term_retention_backup_list_by_database.py | 43 ++ ...term_retention_backup_list_by_instance.py} | 2 +- ..._term_retention_backup_list_by_location.py | 41 ++ ...term_retention_policy_create_or_update.py} | 2 +- ...nstance_long_term_retention_policy_get.py} | 2 +- ...term_retention_policy_list_by_database.py} | 2 +- ...nce_private_endpoint_connection_delete.py} | 2 +- ...stance_private_endpoint_connection_get.py} | 2 +- ...tance_private_endpoint_connection_list.py} | 2 +- ...nce_private_endpoint_connection_update.py} | 2 +- ...ed_instance_private_link_resources_get.py} | 2 +- ...d_instance_private_link_resources_list.py} | 2 +- ...rties.py => managed_instance_query_get.py} | 2 +- ...managed_instance_query_statistics_list.py} | 2 +- ...ged_instance_query_statistics_list_max.py} | 2 +- ...ged_instance_query_statistics_list_min.py} | 2 +- ...tance_remove_maintenance_configuration.py} | 2 +- ...py => managed_instance_tde_certificate.py} | 2 +- ...e.py => managed_instance_time_zone_get.py} | 2 +- ...ed_instance_time_zone_list_by_location.py} | 2 +- ...y => managed_instance_top_queries_list.py} | 2 +- ... managed_instance_top_queries_list_max.py} | 2 +- ... managed_instance_top_queries_list_min.py} | 2 +- ...ties.py => managed_instance_update_max.py} | 2 +- ...ties.py => managed_instance_update_min.py} | 2 +- ...ssessment_create_container_sas_key_min.py} | 2 +- ...ce_vulnerability_assessment_create_max.py} | 2 +- ...sessment_create_storage_access_key_min.py} | 2 +- ...stance_vulnerability_assessment_delete.py} | 2 +- ..._instance_vulnerability_assessment_get.py} | 2 +- ...nerability_assessment_list_by_instance.py} | 2 +- ...py => managed_server_dns_alias_acquire.py} | 2 +- ....py => managed_server_dns_alias_delete.py} | 2 +- ...ias.py => managed_server_dns_alias_get.py} | 2 +- ...es.py => managed_server_dns_alias_list.py} | 2 +- ...naged_server_security_alert_create_max.py} | 2 +- ...naged_server_security_alert_create_min.py} | 2 +- ...y => managed_server_security_alert_get.py} | 2 +- ...server_security_alert_list_by_instance.py} | 2 +- ...anaged_transparent_data_encryption_get.py} | 2 +- ...naged_transparent_data_encryption_list.py} | 2 +- ...ged_transparent_data_encryption_update.py} | 2 +- ...e..py => outbound_firewall_rule_delete.py} | 2 +- ...rule..py => outbound_firewall_rule_get.py} | 2 +- ...ver..py => outbound_firewall_rule_list.py} | 2 +- .../patch_database_default_enclave.py | 43 ++ .../patch_database_vbs_enclave.py | 43 ++ ...nstance_pool.py => patch_instance_pool.py} | 2 +- ...a_database..py => patch_vcore_database.py} | 4 +- ...abase_assign_maintenance_configuration.py} | 4 +- ...tabase_reset_maintenance_configuration.py} | 4 +- ...auses_a_database..py => pause_database.py} | 4 +- .../private_endpoint_connection_delete.py | 42 ++ .../private_endpoint_connection_get.py | 42 ++ .../private_endpoint_connection_list.py | 42 ++ .../private_endpoint_connection_update.py | 50 ++ .../private_link_resources_get.py | 42 ++ .../private_link_resources_list.py | 42 ++ ...ended_column_sensitivity_label_disable.py} | 2 +- ...mended_column_sensitivity_label_enable.py} | 2 +- ...atabase.py => recoverable_database_get.py} | 2 +- ...abases.py => recoverable_database_list.py} | 2 +- ...ames_a_database..py => rename_database.py} | 4 +- ...n_server.py => replication_link_delete.py} | 2 +- ...n_link.py => replication_link_failover.py} | 2 +- ...lication_link_failover_allow_data_loss.py} | 2 +- ...ation_link..py => replication_link_get.py} | 2 +- ...y => replication_link_list_by_database.py} | 2 +- ....py => replication_link_list_by_server.py} | 2 +- ...p_based_long_term_retention_backup_copy.py | 51 ++ ...based_long_term_retention_backup_delete.py | 44 ++ ...up_based_long_term_retention_backup_get.py | 44 ++ ..._term_retention_backup_list_by_database.py | 44 ++ ..._term_retention_backup_list_by_location.py | 42 ++ ...ng_term_retention_backup_list_by_server.py | 43 ++ ...based_long_term_retention_backup_update.py | 45 ++ ...tance_long_term_retention_backup_delete.py | 44 ++ ...instance_long_term_retention_backup_get.py | 44 ++ ..._term_retention_backup_list_by_database.py | 44 ++ ..._term_retention_backup_list_by_instance.py | 43 ++ ..._term_retention_backup_list_by_location.py | 42 ++ ...aged_database_list_by_managed_instance.py} | 2 +- ...umes_a_database..py => resume_database.py} | 4 +- .../sensitivity_labels_current_update.py | 81 +++ ...s_list_by_database_with_source_current.py} | 2 +- ...st_by_database_with_source_recommended.py} | 2 +- .../sensitivity_labels_recommended_update.py | 49 ++ ..._threat_protection_settings_create_max.py} | 2 +- ..._threat_protection_settings_create_min.py} | 2 +- ...dvanced_threat_protection_settings_get.py} | 2 +- ...eat_protection_settings_list_by_server.py} | 2 +- ...erver_advisor.py => server_advisor_get.py} | 2 +- ...ver_advisors.py => server_advisor_list.py} | 2 +- ...er_advisor.py => server_advisor_update.py} | 2 +- ...er.py => server_auditing_settings_list.py} | 2 +- ...ings.py => server_automatic_tuning_get.py} | 2 +- ... => server_automatic_tuning_update_max.py} | 2 +- ... => server_automatic_tuning_update_min.py} | 2 +- ....py => server_blob_auditing_create_max.py} | 2 +- ....py => server_blob_auditing_create_min.py} | 2 +- ..._policy.py => server_blob_auditing_get.py} | 2 +- ...er_communication_link_create_or_update.py} | 2 +- ...py => server_communication_link_delete.py} | 2 +- ...nk.py => server_communication_link_get.py} | 2 +- ...s.py => server_communication_link_list.py} | 2 +- ...y.py => server_connection_policies_get.py} | 2 +- ....py => server_connection_policies_list.py} | 2 +- ...y => server_connection_policies_update.py} | 2 +- .../{create_server.py => server_create.py} | 2 +- .../{delete_server.py => server_delete.py} | 2 +- ....py => server_dev_ops_audit_create_max.py} | 2 +- ....py => server_dev_ops_audit_create_min.py} | 2 +- ...ettings.py => server_dev_ops_audit_get.py} | 2 +- ...server.py => server_dev_ops_audit_list.py} | 2 +- ...s_alias.py => server_dns_alias_acquire.py} | 2 +- ...y => server_dns_alias_create_or_update.py} | 2 +- ...ns_alias.py => server_dns_alias_delete.py} | 2 +- ...r_dns_alias.py => server_dns_alias_get.py} | 2 +- ...ns_aliases.py => server_dns_alias_list.py} | 2 +- ...server_extended_auditing_settings_list.py} | 2 +- .../{get_server.py => server_get.py} | 2 +- ..._get_with_expand_equals_administrators.py} | 2 +- ..._key.py => server_key_create_or_update.py} | 2 +- ...the_server_key.py => server_key_delete.py} | 2 +- ...et_the_server_key.py => server_key_get.py} | 2 +- ...r_keys_by_server.py => server_key_list.py} | 2 +- .../{list_servers.py => server_list.py} | 2 +- ...up.py => server_list_by_resource_group.py} | 2 +- ...roup_with_expand_equals_administrators.py} | 2 +- ...list_with_expand_equals_administrators.py} | 2 +- ... server_recommended_action_list_expand.py} | 2 +- ...y => server_security_alerts_create_max.py} | 2 +- ...y => server_security_alerts_create_min.py} | 2 +- ...olicy.py => server_security_alerts_get.py} | 2 +- ... server_security_alerts_list_by_server.py} | 2 +- ...py => server_trust_certificates_create.py} | 2 +- ...py => server_trust_certificates_delete.py} | 2 +- ...e..py => server_trust_certificates_get.py} | 2 +- ...er_trust_certificates_list_by_instance.py} | 2 +- ..._group.py => server_trust_group_create.py} | 2 +- ..._group.py => server_trust_group_delete.py} | 2 +- ...ust_group.py => server_trust_group_get.py} | 2 +- ...t_groups.py => server_trust_group_list.py} | 2 +- ...r_trust_group_list_by_managed_instance.py} | 2 +- .../{update_a_server.py => server_update.py} | 2 +- ...usages.py => server_usage_metrics_list.py} | 2 +- ...ssessment_create_container_sas_key_min.py} | 2 +- ...er_vulnerability_assessment_create_max.py} | 2 +- ...sessment_create_storage_access_key_min.py} | 2 +- ...server_vulnerability_assessment_delete.py} | 2 +- ...=> server_vulnerability_assessment_get.py} | 2 +- ...ulnerability_assessment_list_by_server.py} | 2 +- ..._objective.py => service_objective_get.py} | 2 +- ...bjectives.py => service_objective_list.py} | 2 +- ...ion..py => sql_agent_configuration_get.py} | 2 +- ...nce..py => sql_agent_configuration_put.py} | 2 +- .../sql_tde_certificate_create.py | 42 ++ ...l_vulnerability_assessment_baseline_add.py | 52 ++ ...rability_assessment_baseline_add_latest.py | 44 ++ ...l_vulnerability_assessment_baseline_get.py | 43 ++ ...ne_list_by_sql_vulnerability_assessment.py | 43 ++ ...=> sql_vulnerability_assessment_create.py} | 2 +- ...=> sql_vulnerability_assessment_delete.py} | 2 +- ...py => sql_vulnerability_assessment_get.py} | 2 +- ...ulnerability_assessment_list_by_server.py} | 2 +- ...rability_assessment_list_scans_results.py} | 2 +- ...ability_assessment_rule_baseline_create.py | 50 ++ ...ability_assessment_rule_baseline_delete.py | 44 ++ ...nerability_assessment_rule_baseline_get.py | 44 ++ ...essment_rule_baseline_list_by_baseline.py} | 2 +- ...y => sql_vulnerability_assessment_scan.py} | 2 +- ...ssessment_scan_records_list_by_database.py | 43 ++ ..._vulnerability_assessment_scans_execute.py | 42 ++ ...vulnerability_assessment_scans_results.py} | 2 +- ...location..py => subscription_usage_get.py} | 2 +- ...=> subscription_usage_list_by_location.py} | 2 +- ...ynapse_link_workspace_list_by_database.py} | 2 +- ...new_sync_agent.py => sync_agent_create.py} | 2 +- ...e_a_sync_agent.py => sync_agent_delete.py} | 2 +- ...gent_key.py => sync_agent_generate_key.py} | 2 +- ...{get_a_sync_agent.py => sync_agent_get.py} | 2 +- ....py => sync_agent_get_linked_databases.py} | 2 +- ...server.py => sync_agent_list_by_server.py} | 2 +- ...e_a_sync_agent.py => sync_agent_update.py} | 2 +- ...onization.py => sync_group_cancel_sync.py} | 2 +- ...e_a_sync_group.py => sync_group_create.py} | 2 +- ...e_a_sync_group.py => sync_group_delete.py} | 2 +- ...{get_a_sync_group.py => sync_group_get.py} | 2 +- ...chema..py => sync_group_get_hub_schema.py} | 2 +- ...nc_group_logs.py => sync_group_get_log.py} | 2 +- ....py => sync_group_get_sync_database_id.py} | 2 +- ...base.py => sync_group_list_by_database.py} | 2 +- .../generated_samples/sync_group_patch.py | 53 ++ ...a..py => sync_group_refresh_hub_schema.py} | 2 +- ...ization..py => sync_group_trigger_sync.py} | 2 +- ...e_a_sync_group.py => sync_group_update.py} | 2 +- ...w_sync_member.py => sync_member_create.py} | 2 +- ...a_sync_member.py => sync_member_delete.py} | 2 +- ...et_a_sync_member.py => sync_member_get.py} | 2 +- ...er_schema.py => sync_member_get_schema.py} | 2 +- ...p.py => sync_member_list_by_sync_group.py} | 2 +- ...ng_sync_member.py => sync_member_patch.py} | 2 +- ...chema.py => sync_member_refresh_schema.py} | 2 +- ...a_sync_member.py => sync_member_update.py} | 2 +- .../transparent_data_encryption_get.py | 43 ++ ...py => transparent_data_encryption_list.py} | 2 +- .../transparent_data_encryption_update.py | 44 ++ ...b_agent's_tags..py => update_job_agent.py} | 2 +- ...te_managed_short_term_retention_policy.py} | 2 +- ...rm_retention_policy_restorable_dropped.py} | 2 +- .../update_short_term_retention_policy.py | 44 ++ ... => update_virtual_cluster_dns_servers.py} | 2 +- ...arehouse..py => upgrade_data_warehouse.py} | 4 +- ...l_cluster.py => virtual_cluster_delete.py} | 2 +- ...tual_cluster.py => virtual_cluster_get.py} | 2 +- ...al_clusters.py => virtual_cluster_list.py} | 2 +- ...virtual_cluster_list_by_resource_group.py} | 2 +- ...with_tags.py => virtual_cluster_update.py} | 2 +- ...virtual_network_rules_create_or_update.py} | 2 +- ...ule.py => virtual_network_rules_delete.py} | 2 +- ...k_rule.py => virtual_network_rules_get.py} | 2 +- ...rules.py => virtual_network_rules_list.py} | 2 +- 914 files changed, 18618 insertions(+), 12005 deletions(-) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_or_updates_an_existing_azure_active_directory_administrator..py => administrator_create_or_update.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_azure_active_directory_administrator..py => administrator_delete.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_azure_active_directory_administrator..py => administrator_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_list_of_azure_active_directory_administrator..py => administrator_list.py} (95%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_create_or_update.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_delete.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_get.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_list.py rename sdk/sql/azure-mgmt-sql/generated_samples/{cancel_the_database_management_operation.py => cancel_database_operation.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{cancel_the_elastic_pool_management_operation.py => cancel_elastic_pool_operation.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{cancel_a_job_execution..py => cancel_job_execution.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{cancel_the_managed_instance_management_operation.py => cancel_managed_instance_operation.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{check_for_a_server_name_that_already_exists.py => check_name_availability_server_already_exists.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{check_for_a_server_name_that_is_available.py => check_name_availability_server_available.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{check_for_a_server_name_that_is_invalid.py => check_name_availability_server_invalid.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{updates_the_sensitivity_label_of_a_given_column_with_all_parameters.py => column_sensitivity_label_create_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{deletes_the_sensitivity_label_of_a_given_column.py => column_sensitivity_label_delete.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_the_sensitivity_label_of_a_given_column.py => column_sensitivity_label_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{filter_database_columns.py => columns_list_by_database_max.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_database_columns.py => columns_list_by_database_min.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_database_with_specified_backup_storage_redundancy..py => create_database_configured_backup_storage_redundancy.py} (92%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_database_as_a_copy..py => create_database_copy_mode.py} (94%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_enclave.py rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_database_with_default_mode..py => create_database_default_mode.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_database_with_ledger_on..py => create_database_ledger.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_database_with_preferred_maintenance_window..py => create_database_maintenance_configuration.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_database_with_minimum_number_of_parameters..py => create_database_min.py} (92%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_database_as_named_replica_secondary..py => create_database_named_replica.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_database_from_point_in_time_restore..py => create_database_pitr_mode.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_database_as_an_online_secondary..py => create_database_secondary_mode.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_database_as_a_standby_secondary..py => create_database_standby_mode.py} (94%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/create_database_vbs_enclave.py rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_restore_point_of_an_existing_database..py => create_dw_database_cross_subscription_pitr.py} (91%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_geobackup..py => create_dw_database_cross_subscription_recovery.py} (92%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_backup_of_a_dropped_database..py => create_dw_database_cross_subscription_restore.py} (91%) rename sdk/sql/azure-mgmt-sql/generated_samples/{start_a_job_execution..py => create_job_execution.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_database_extensions..py => create_or_update_database_extensions.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_an_instance_pool_with_all_properties..py => create_or_update_instance_pool_max.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_an_instance_pool_with_min_properties..py => create_or_update_instance_pool_min.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_a_job_agent.py => create_or_update_job_agent.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_a_credential.py => create_or_update_job_credential.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_job_execution..py => create_or_update_job_execution.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_job_with_all_properties_specified.py => create_or_update_job_max.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_a_job_step_with_all_properties_specified..py => create_or_update_job_step_max.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_a_job_step_with_minimal_properties_specified..py => create_or_update_job_step_min.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_a_target_group_with_all_properties..py => create_or_update_job_target_group_max.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_a_target_group_with_minimal_properties..py => create_or_update_job_target_group_min.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{sets_maintenance_window_settings_for_a_selected_database..py => create_or_update_maintenance_windows.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_workload_group_with_all_properties_specified..py => create_or_update_workload_classifier_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_workload_group_with_the_required_properties_specified..py => create_or_update_workload_classifier_min.py} (95%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_max.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_min.py rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_vcore_database_by_specifying_service_objective_name..py => create_vcore_database_by_service_objective.py} (92%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_vcore_database_by_specifying_sku_name_and_capacity..py => create_vcore_database_by_sku_name_capacity.py} (92%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_data_masking_policy_max.py => data_masking_policy_create_or_update_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_data_masking_policy_min.py => data_masking_policy_create_or_update_min.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_data_masking_policy.py => data_masking_policy_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create/_update_data_masking_rule_for_default_max.py => data_masking_rule_create_or_update_default_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create/_update_data_masking_rule_for_default_min.py => data_masking_rule_create_or_update_default_min.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create/_update_data_masking_rule_for_numbers.py => data_masking_rule_create_or_update_number.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create/_update_data_masking_rule_for_text.py => data_masking_rule_create_or_update_text.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_data_masking_rules.py => data_masking_rule_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_datawarehouse_database_restore_point..py => data_warehouse_restore_points_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_datawarehouse_database_restore_points..py => data_warehouse_restore_points_list_by_database.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_database's_advanced_threat_protection_settings_with_all_parameters.py => database_advanced_threat_protection_settings_create_max.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_database's_advanced_threat_protection_settings_with_minimal_parameters.py => database_advanced_threat_protection_settings_create_min.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_database's_advanced_threat_protection_settings..py => database_advanced_threat_protection_settings_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{lists_the_database's_advanced_threat_protection_settings..py => database_advanced_threat_protection_settings_list_by_database.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_database_advisor.py => database_advisor_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_of_database_advisors.py => database_advisor_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_database_advisor.py => database_advisor_update.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_audit_settings_of_a_database.py => database_auditing_settings_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_database's_automatic_tuning_settings.py => database_automatic_tuning_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{updates_database_automatic_tuning_settings_with_all_properties.py => database_automatic_tuning_update_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{updates_database_automatic_tuning_settings_with_minimal_properties.py => database_automatic_tuning_update_min.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_a_database's_azure_monitor_auditing_policy_with_minimal_parameters.py => database_azure_monitor_auditing_create_min.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_a_database's_blob_auditing_policy_with_all_parameters.py => database_blob_auditing_create_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_a_database's_blob_auditing_policy_with_minimal_parameters.py => database_blob_auditing_create_min.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_database's_blob_auditing_policy.py => database_blob_auditing_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_database_column.py => database_column_get.py} (97%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/database_column_list_by_table.py rename sdk/sql/azure-mgmt-sql/generated_samples/{list_extended_auditing_settings_of_a_database.py => database_extended_auditing_settings_list.py} (96%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_definitions_list.py rename sdk/sql/azure-mgmt-sql/generated_samples/{list_database_usage_metrics.py => database_metrics_list_with_filter.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_database_recommended_action.py => database_recommended_action_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_of_database_recommended_actions.py => database_recommended_action_list.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_of_database_recommended_actions_for_all_advisors.py => database_recommended_action_list_expand.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_database_recommended_action.py => database_recommended_action_update.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{deletes_a_restore_point..py => database_restore_points_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_database_restore_point..py => database_restore_points_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_database_restore_points..py => database_restore_points_list_by_database.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_datawarehouse_database_restore_point..py => database_restore_points_post.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_database_schema.py => database_schema_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_database_schemas.py => database_schema_list_by_database.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_database's_threat_detection_policy_with_all_parameters.py => database_security_alert_create_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_database's_threat_detection_policy_with_minimal_parameters.py => database_security_alert_create_min.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_database's_threat_detection_policy.py => database_security_alert_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_database's_threat_detection_policies.py => database_security_alert_list_by_database.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{add_a_database's_vulnerability_assessment_rule_baseline_list..py => database_sql_vulnerability_assessment_baseline_add.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{add_a_database's_vulnerability_assessment_rule_baseline_from_the_latest_scan_result..py => database_sql_vulnerability_assessment_baseline_add_latest.py} (94%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.py rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_list_of_database's_sql_vulnerability_assessment_rule_baselines..py => database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_sql_vulnerability_assessment_policy_for_database.py => database_sql_vulnerability_assessment_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_sql_vulnerability_assessment_policies_on_a_given_database.py => database_sql_vulnerability_assessment_list_by_database.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_database_sql_vulnerability_assessment_scan_results_for_scan_id.py => database_sql_vulnerability_assessment_list_scans_results.py} (95%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_delete.py rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_database's_sql_vulnerability_assessment_rule_baseline..py => database_sql_vulnerability_assessment_rule_baseline_get.py} (95%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.py rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_database's_vulnerability_assessment_scan..py => database_sql_vulnerability_assessment_scan.py} (96%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_execute.py rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.py => database_sql_vulnerability_assessment_scans_results.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_database_table.py => database_table_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_database_tables.py => database_table_list_by_schema.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py => database_vulnerability_assessment_create_container_sas_key_min.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_database's_vulnerability_assessment_with_all_parameters.py => database_vulnerability_assessment_create_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py => database_vulnerability_assessment_create_storage_access_key_min.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{remove_a_database's_vulnerability_assessment.py => database_vulnerability_assessment_delete.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_database's_vulnerability_assessment.py => database_vulnerability_assessment_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_database's_vulnerability_assessment_policies.py => database_vulnerability_assessment_list_by_database.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_or_updates_a_database's_vulnerability_assessment_rule_baseline..py => database_vulnerability_assessment_rule_baseline_create.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{removes_a_database's_vulnerability_assessment_rule_baseline..py => database_vulnerability_assessment_rule_baseline_delete.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_database's_vulnerability_assessment_rule_baseline..py => database_vulnerability_assessment_rule_baseline_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{export_a_database's_vulnerability_assessment_scan_results..py => database_vulnerability_assessment_scan_export.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_database_vulnerability_assessment_scan_record_by_scan_id.py => database_vulnerability_assessment_scan_records_get.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_the_list_of_a_database_vulnerability_assessment_scan_records.py => database_vulnerability_assessment_scan_records_list_by_database.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{executes_a_database's_vulnerability_assessment_scan..py => database_vulnerability_assessment_scans_execute.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{deletes_a_database..py => delete_database.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_an_instance_pool.py => delete_instance_pool.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_a_job.py => delete_job.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_a_job_agent.py => delete_job_agent.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_a_credential.py => delete_job_credential.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_a_job_step..py => delete_job_step.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_a_target_group..py => delete_job_target_group.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_a_workload_classifier.py => delete_workload_classifier.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_a_workload_group.py => delete_workload_group.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_deleted_server.py => deleted_server_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_deleted_servers.py => deleted_server_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_deleted_servers_in_a_subscription.py => deleted_server_list_by_subscription.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{recover_deleted_server..py => deleted_server_recover.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_distributed_availability_group..py => distributed_availability_groups_create.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{initiate_a_distributed_availability_group_drop..py => distributed_availability_groups_delete.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_the_distributed_availability_group_info..py => distributed_availability_groups_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{lists_all_distributed_availability_groups_in_instance..py => distributed_availability_groups_list_by_instance.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_the_distributed_availability_group_replication_mode_before_deleting_it..py => distributed_availability_groups_update.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_elastic_pool_activity.py => elastic_pool_activity_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_elastic_pool_with_all_parameter.py => elastic_pool_create_or_update_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_elastic_pool_with_minimum_parameters.py => elastic_pool_create_or_update_min.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_elastic_pool_with_maintenance_configuration_parameter.py => elastic_pool_create_or_update_set_maintenance_configuration.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_elastic_pool_database_activity.py => elastic_pool_database_activity_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_an_elastic_pool.py => elastic_pool_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_an_elastic_pool.py => elastic_pool_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_all_elastic_pools_in_a_server.py => elastic_pool_list_by_server.py} (97%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_definitions_list.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_list_with_filter.py rename sdk/sql/azure-mgmt-sql/generated_samples/{assigns_maintenance_configuration_to_an_elastic_pool..py => elastic_pool_update_assign_maintenance_configuration.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_an_elastic_pool_with_all_parameter.py => elastic_pool_update_max.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{resets_maintenance_configuration_of_an_elastic_pool_to_default..py => elastic_pool_update_reset_maintenance_configuration.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_the_encryption_protector_to_key_vault.py => encryption_protector_create_or_update_key_vault.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_the_encryption_protector_to_service_managed.py => encryption_protector_create_or_update_service_managed.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_encryption_protector.py => encryption_protector_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_encryption_protectors_by_server.py => encryption_protector_list.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{revalidates_the_encryption_protector.py => encryption_protector_revalidate.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_an_endpoint_certificate..py => endpoint_certificates_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_list_of_endpoint_certificates..py => endpoint_certificates_list_by_instance.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{exports_a_database..py => export_database.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{exports_a_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..py => export_database_with_network_isolation.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_an_extended_database's_azure_monitor_auditing_policy_with_minimal_parameters.py => extended_database_azure_monitor_auditing_create_min.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_an_extended_database's_blob_auditing_policy_with_all_parameters.py => extended_database_blob_auditing_create_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_an_extended_database's_blob_auditing_policy_with_minimal_parameters.py => extended_database_blob_auditing_create_min.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_an_extended_database's_blob_auditing_policy.py => extended_database_blob_auditing_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_server's_extended_blob_auditing_policy_with_all_parameters.py => extended_server_blob_auditing_create_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_server's_extended_blob_auditing_policy_with_minimal_parameters.py => extended_server_blob_auditing_create_min.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_server's_blob_extended_auditing_policy.py => extended_server_blob_auditing_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{failover_an_database.py => failover_database.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{failover_an_elastic_pool.py => failover_elastic_pool.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_failover_group.py => failover_group_create_or_update.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_failover_group.py => failover_group_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{planned_failover_of_a_failover_group.py => failover_group_failover.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{forced_failover_of_a_failover_group_allowing_data_loss.py => failover_group_force_failover_allow_data_loss.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_failover_group.py => failover_group_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_failover_group.py => failover_group_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_failover_group.py => failover_group_update.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{failover_a_managed_instance..py => failover_managed_instance.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_firewall_rule_max/min.py => firewall_rule_create.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_a_firewall_rule.py => firewall_rule_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_firewall_rule.py => firewall_rule_get.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_firewall_rules.py => firewall_rule_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{replace_firewall_rules.py => firewall_rule_replace.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_firewall_rule_max/min.py => firewall_rule_update.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_geo_backup_policy.py => geo_backup_policies_create_or_update.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_geo_backup_policy.py => geo_backup_policies_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_geo_backup_policies.py => geo_backup_policies_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_list_of_the_user_activities_of_a_data_warehouse.py => get_data_warehouse_user_activities.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_database_extensions..py => get_database_extensions.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_database_usages..py => get_database_usages.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_an_instance_pool.py => get_instance_pool.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_job.py => get_job.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_job_agent.py => get_job_agent.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_credential.py => get_job_credential.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_job_execution..py => get_job_execution.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_job_step_execution.py => get_job_execution_step.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_job_step_target_execution.py => get_job_execution_target.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_latest_version_of_a_job_step..py => get_job_step_by_job.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_specified_version_of_a_job_step..py => get_job_step_by_version.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_target_group..py => get_job_target_group.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_version_of_a_job..py => get_job_version.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_short_term_retention_policy_list_for_the_database..py => get_list_managed_short_term_retention_policy.py} (95%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy_restorable_dropped.py rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_list_of_available_maintenance_windows_for_a_selected_database..py => get_maintenance_window_options.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_maintenance_window_settings_for_a_selected_database..py => get_maintenance_windows.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_the_managed_instance_management_operation.py => get_managed_instance_operation.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_short_term_retention_policy_for_the_database..py => get_managed_short_term_retention_policy.py} (96%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy_restorable_dropped.py rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_recoverable_databases_by_managed_instances.py => get_recoverable_managed_database.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_restorable_dropped_database..py => get_restorable_dropped_database.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_restorable_dropped_managed_database..py => get_restorable_dropped_managed_database.py} (96%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/get_short_term_retention_policy.py rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_database..py => get_vcore_database.py} (93%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_default_enclave.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_vbs_enclave.py rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_workload_classifier_for_a_data_warehouse.py => get_workload_classifier.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_list_of_workload_classifiers_for_a_workload_group.py => get_workload_classifier_list.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_workload_group_for_a_data_warehouse.py => get_workload_group.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_list_of_workload_groups_for_a_data_warehouse.py => get_workload_group_list.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_hyperscale_elastic_pool_with_high_availability_replica_count_parameter.py => hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_hyperscale_elastic_pool.py => hyperscale_elastic_pool_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_high_availability_replica_count_of_a_hyperscale_elastic_pool..py => hyperscale_elastic_pool_update_set_high_availability_replica_count.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{imports_to_an_existing_empty_database..py => import_database.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{imports_to_an_existing_empty_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..py => import_database_with_network_isolation.py} (92%) rename sdk/sql/azure-mgmt-sql/generated_samples/{imports_to_a_new_database..py => import_new_database.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{imports_to_a_new_database,_using_private_link_for_the_sql_server_and_storage_account..py => import_new_database_with_network_isolation.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_inaccessible_managed_databases_by_managed_instances.py => inaccessible_managed_database_list_by_managed_instance.py} (95%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_create_or_update.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_delete.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_failover.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_force_failover_allow_data_loss.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_get.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_list.py rename sdk/sql/azure-mgmt-sql/generated_samples/{create_an_ipv6_firewall_rule_max/min.py => ipv6_firewall_rule_create.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_an_ipv6_firewall_rule.py => ipv6_firewall_rule_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_ipv6_firewall_rule.py => ipv6_firewall_rule_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_ipv6_firewall_rules.py => ipv6_firewall_rule_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_an_ipv6_firewall_rule_max/min.py => ipv6_firewall_rule_update.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{disables_uploading_ledger_digests_for_a_database.py => ledger_digest_uploads_disable.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{enables_ledger_digest_upload_configuration_for_a_database.py => ledger_digest_uploads_enable.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_the_current_ledger_digest_upload_configuration_for_a_database..py => ledger_digest_uploads_get.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_list_of_ledger_digest_upload_settings_on_a_database..py => ledger_digest_uploads_list.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_of_the_user_activities_of_a_data_warehouse.py => list_data_warehouse_user_activities.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_database_extensions..py => list_database_extensions.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_the_database_management_operations.py => list_database_operations.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_list_of_databases_in_an_elastic_pool..py => list_databases_by_elastic_pool.py} (92%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_the_elastic_pool_management_operations.py => list_elastic_pool_operations.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_instance_pool_usages..py => list_instance_pool_usage.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_instance_pool_usages_expanded_with_children..py => list_instance_pool_usage_expanded.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_instance_pools_in_the_subscription.py => list_instance_pools_by_subscription_id.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_job_agents_in_a_server.py => list_job_agents_by_server.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_credentials_in_a_job_agent.py => list_job_credentials_by_agent.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_job_step_executions.py => list_job_execution_steps.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_job_step_target_executions.py => list_job_execution_targets_by_execution.py} (96%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_step.py rename sdk/sql/azure-mgmt-sql/generated_samples/{list_all_job_executions_in_a_job_agent..py => list_job_executions_by_agent.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_all_job_executions_in_a_job_agent_with_filtering..py => list_job_executions_by_agent_with_filter.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_a_job's_executions..py => list_job_executions_by_job.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_job_steps_for_the_latest_version_of_a_job..py => list_job_steps_by_job.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_job_steps_for_the_specified_version_of_a_job..py => list_job_steps_by_version.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_all_target_groups_in_an_agent..py => list_job_target_groups.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_all_versions_of_a_job..py => list_job_versions.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_jobs_in_a_job_agent.py => list_jobs_by_agent.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_the_managed_instance_management_operations.py => list_managed_instance_operations.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_recoverable_databases_by_managed_instances.py => list_recoverable_managed_databases_by_server.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_list_of_restorable_dropped_databases..py => list_restorable_dropped_databases_by_server.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_the_server_management_operations.py => list_server_operations.py} (96%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/list_short_term_retention_policies_by_database.py rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_list_of_databases..py => list_vcore_databases_by_server.py} (93%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_enclave_type_by_server.py rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_list_of_inaccessible_databases_in_a_logical_server.py => list_vcore_inaccessible_databases_by_server.py} (91%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_subscription_capabilities_in_the_given_location..py => location_capability_list_by_location.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{copy_the_long_term_retention_backup..py => long_term_retention_backup_copy.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_the_long_term_retention_backup..py => long_term_retention_backup_delete.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_long_term_retention_backup..py => long_term_retention_backup_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_all_long_term_retention_backups_under_the_database..py => long_term_retention_backup_list_by_database.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_all_long_term_retention_backups_under_the_location..py => long_term_retention_backup_list_by_location.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_all_long_term_retention_backups_under_the_server..py => long_term_retention_backup_list_by_server.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_the_long_term_retention_backup..py => long_term_retention_backup_update.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_the_long_term_retention_policy_for_the_database..py => long_term_retention_policy_create_or_update.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_long_term_retention_policy_for_the_database..py => long_term_retention_policy_get.py} (95%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_list_by_database.py rename sdk/sql/azure-mgmt-sql/generated_samples/{filter_managed_database_columns.py => managed_columns_list_by_database_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_managed_database_columns.py => managed_columns_list_by_database_min.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_managed_database's_advanced_threat_protection_settings_with_all_parameters.py => managed_database_advanced_threat_protection_settings_create_max.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_managed_database's_advanced_threat_protection_settings_with_minimal_parameters.py => managed_database_advanced_threat_protection_settings_create_min.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_managed_database's_advanced_threat_protection_settings..py => managed_database_advanced_threat_protection_settings_get.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_list_of_the_managed_database's_advanced_threat_protection_settings..py => managed_database_advanced_threat_protection_settings_list_by_database.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{cancels_a_managed_database_move..py => managed_database_cancel_move.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_managed_database_column.py => managed_database_column_get.py} (97%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_list_by_table.py rename sdk/sql/azure-mgmt-sql/generated_samples/{updates_or_creates_a_sensitivity_label_of_a_given_column_with_all_parameters_in_a_managed_database.py => managed_database_column_sensitivity_label_create.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{deletes_the_sensitivity_label_of_a_given_column_in_a_managed_database.py => managed_database_column_sensitivity_label_delete.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_the_sensitivity_label_of_a_given_column_in_a_managed_database.py => managed_database_column_sensitivity_label_get.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{completes_a_managed_database_external_backup_restore..py => managed_database_complete_external_restore.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{completes_a_managed_database_move..py => managed_database_complete_move.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_new_managed_database_with_maximal_properties.py => managed_database_create_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_new_managed_database_with_minimal_properties.py => managed_database_create_min.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_new_managed_database_using_point_in_time_restore.py => managed_database_create_point_in_time_restore.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_new_managed_database_from_restoring_a_georeplicated_backup.py => managed_database_create_recovery.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_new_managed_database_by_restoring_from_an_external_backup.py => managed_database_create_restore_external_backup.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_new_managed_database_by_restoring_from_an_external_backup_using_managed_identity.py => managed_database_create_restore_external_backup_managed_identity.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_a_new_managed_database_from_restoring_a_long_term_retention_backup.py => managed_database_create_restore_ltr_backup.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_managed_database.py => managed_database_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_managed_database.py => managed_database_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_databases_by_managed_instances.py => managed_database_list_by_managed_instance.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_managed_database_move_operation..py => managed_database_move_operation_result_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_all_managed_database_move_operations_for_specified_subscription,_resource_group_and_location..py => managed_database_move_operation_result_list.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location..py => managed_database_move_operation_result_list_last_operations.py} (91%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location,_filtered_by_operation_type_.py => managed_database_move_operation_result_list_max.py} (90%) rename sdk/sql/azure-mgmt-sql/generated_samples/{disables_the_sensitivity_recommendations_on_a_given_column.py => managed_database_recommended_column_sensitivity_label_disable.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{enables_the_sensitivity_recommendations_on_a_given_column.py => managed_database_recommended_column_sensitivity_label_enable.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{managed_database_restore_details..py => managed_database_restore_details.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_managed_database_schema.py => managed_database_schema_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_managed_database_schemas.py => managed_database_schema_list_by_database.py} (96%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_max.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_min.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_get.py rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_list_of_the_database's_threat_detection_policies..py => managed_database_security_alert_list_by_database.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_managed_database's_security_events_with_maximal_parameters.py => managed_database_security_events_get_max.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_managed_database's_security_events_with_minimal_parameters.py => managed_database_security_events_get_min.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_sensitivity_labels_of_a_given_database_using_an_operations_batch..py => managed_database_sensitivity_labels_current_update.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_the_current_sensitivity_labels_of_a_given_database_in_a_managed_database.py => managed_database_sensitivity_labels_list_by_database_current.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_the_recommended_sensitivity_labels_of_a_given_database_in_a_managed_database.py => managed_database_sensitivity_labels_list_by_database_recommended.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_recommended_sensitivity_labels_of_a_given_database_using_an_operations_batch..py => managed_database_sensitivity_labels_recommended_update.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{starts_a_managed_database_move_with_all_optional_parameters_specified..py => managed_database_start_move_max.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{starts_a_managed_database_move_with_no_optional_parameters_specified..py => managed_database_start_move_min.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_managed_database_table.py => managed_database_table_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_managed_database_tables.py => managed_database_table_list_by_schema.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{updates_a_managed_database_with_maximal_properties.py => managed_database_update_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{updates_a_managed_database_with_minimal_properties.py => managed_database_update_min.py} (96%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_max.py rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_database's_vulnerability_assessment_with_minimal_parameters.py => managed_database_vulnerability_assessment_create_min.py} (95%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_get.py rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_database's_vulnerability_assessments_list.py => managed_database_vulnerability_assessment_list_by_database.py} (95%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_create.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_get.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_export.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_get.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_list_by_database.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.py rename sdk/sql/azure-mgmt-sql/generated_samples/{create_administrator_of_managed_instance.py => managed_instance_administrator_create.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_administrator_of_managed_instance.py => managed_instance_administrator_delete.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_administrator_of_managed_instance.py => managed_instance_administrator_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_administrators_of_managed_instance.py => managed_instance_administrator_list_by_instance.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_administrator_of_managed_instance.py => managed_instance_administrator_update.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_managed_instance's_advanced_threat_protection_settings_with_all_parameters..py => managed_instance_advanced_threat_protection_settings_create_max.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_managed_instance's_advanced_threat_protection_settings_with_minimal_parameters..py => managed_instance_advanced_threat_protection_settings_create_min.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_managed_instance's_advanced_threat_protection_settings.py => managed_instance_advanced_threat_protection_settings_get.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_the_managed_instance's_advanced_threat_protection_settings..py => managed_instance_advanced_threat_protection_settings_list_by_instance.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_or_updates_azure_active_directory_only_authentication_object..py => managed_instance_azure_ad_only_auth_create_or_update.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{deletes_azure_active_directory_only_authentication_object..py => managed_instance_azure_ad_only_auth_delete.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_azure_active_directory_only_authentication_property..py => managed_instance_azure_ad_only_auth_get.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_list_of_azure_active_directory_only_authentication_object..py => managed_instance_azure_ad_only_auth_list_by_instance.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_managed_instance_with_all_properties.py => managed_instance_create_max.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_managed_instance_with_minimal_properties.py => managed_instance_create_min.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_managed_instance.py => managed_instance_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_managed_instance_dtc_settings..py => managed_instance_dtc_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_list_of_managed_instance_dtc_settings..py => managed_instance_dtc_list.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{updates_managed_instance_dtc_settings_by_enabling_dtc..py => managed_instance_dtc_update_enable_dtc.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{updates_managed_instance_dtc_settings_with_all_optional_parameters_specified..py => managed_instance_dtc_update_max.py} (96%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_key_vault.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_service_managed.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_get.py rename sdk/sql/azure-mgmt-sql/generated_samples/{list_encryption_protectors_by_managed_instance.py => managed_instance_encryption_protector_list.py} (96%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.py rename sdk/sql/azure-mgmt-sql/generated_samples/{get_managed_instance.py => managed_instance_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_managed_instance_with_$expand=administrators/activedirectory.py => managed_instance_get_with_expand_equals_administrators.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_or_updates_a_managed_instance_key.py => managed_instance_key_create_or_update.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_the_managed_instance_key.py => managed_instance_key_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_managed_instance_key.py => managed_instance_key_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_the_keys_for_a_managed_instance..py => managed_instance_key_list.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_managed_instances.py => managed_instance_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_managed_instances_by_instance_pool.py => managed_instance_list_by_instance_pool.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_managed_instances_by_instance_pool_with_$expand=administrators/activedirectory.py => managed_instance_list_by_instance_pool_with_expand_equals_administrators.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_managed_instances_by_resource_group.py => managed_instance_list_by_resource_group.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_managed_instances_by_resource_group_with_$expand=administrators/activedirectory.py => managed_instance_list_by_resource_group_with_expand_equals_administrators.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_managed_instances_with_$expand=administrators/activedirectory.py => managed_instance_list_with_expand_equals_administrators.py} (94%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.py rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_long_term_retention_backup_of_a_managed_database..py => managed_instance_long_term_retention_backup_get.py} (95%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_database.py rename sdk/sql/azure-mgmt-sql/generated_samples/{get_all_long_term_retention_backups_under_the_managed_instance..py => managed_instance_long_term_retention_backup_list_by_instance.py} (95%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location.py rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_the_ltr_policy_for_the_managed_database..py => managed_instance_long_term_retention_policy_create_or_update.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_long_term_retention_policy_for_the_managed_database..py => managed_instance_long_term_retention_policy_get.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_long_term_retention_policies_for_the_managed_database..py => managed_instance_long_term_retention_policy_list_by_database.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{deletes_a_private_endpoint_connection_with_a_given_name..py => managed_instance_private_endpoint_connection_delete.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_private_endpoint_connection..py => managed_instance_private_endpoint_connection_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_list_of_private_endpoint_connections_on_a_server..py => managed_instance_private_endpoint_connection_list.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{approve_or_reject_a_private_endpoint_connection_with_a_given_name..py => managed_instance_private_endpoint_connection_update.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_private_link_resource_for_sql..py => managed_instance_private_link_resources_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_private_link_resources_for_sql..py => managed_instance_private_link_resources_list.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{obtain_query_properties.py => managed_instance_query_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{obtain_query_execution_statistics.py => managed_instance_query_statistics_list.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{obtain_query_execution_statistics._example_with_all_request_parameters..py => managed_instance_query_statistics_list_max.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{obtain_query_execution_statistics._minimal_example_with_only_mandatory_request_parameters..py => managed_instance_query_statistics_list_min.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{remove_maintenance_policy_from_managed_instance_(select_default_maintenance_policy).py => managed_instance_remove_maintenance_configuration.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{upload_a_tde_certificate.py => managed_instance_tde_certificate.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_managed_instance_time_zone.py => managed_instance_time_zone_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_managed_instance_time_zones_by_location.py => managed_instance_time_zone_list_by_location.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{obtain_list_of_instance's_top_resource_consuming_queries..py => managed_instance_top_queries_list.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{obtain_list_of_instance's_top_resource_consuming_queries._fullblown_request_and_response..py => managed_instance_top_queries_list_max.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{obtain_list_of_instance's_top_resource_consuming_queries._minimal_request_and_response..py => managed_instance_top_queries_list_min.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_managed_instance_with_all_properties.py => managed_instance_update_max.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_managed_instance_with_minimal_properties.py => managed_instance_update_min.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py => managed_instance_vulnerability_assessment_create_container_sas_key_min.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_managed_instance's_vulnerability_assessment_with_all_parameters.py => managed_instance_vulnerability_assessment_create_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py => managed_instance_vulnerability_assessment_create_storage_access_key_min.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{remove_a_managed_instance's_vulnerability_assessment.py => managed_instance_vulnerability_assessment_delete.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_managed_instance's_vulnerability_assessment.py => managed_instance_vulnerability_assessment_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_managed_instance's_vulnerability_assessment_policies.py => managed_instance_vulnerability_assessment_list_by_instance.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{acquire_managed_server_dns_alias..py => managed_server_dns_alias_acquire.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_managed_server_dns_alias.py => managed_server_dns_alias_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_managed_server_dns_alias.py => managed_server_dns_alias_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_managed_server_dns_aliases.py => managed_server_dns_alias_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_managed_server's_threat_detection_policy_with_all_parameters.py => managed_server_security_alert_create_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_managed_server's_threat_detection_policy_with_minimal_parameters.py => managed_server_security_alert_create_min.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_managed_server's_threat_detection_policy.py => managed_server_security_alert_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_managed_server's_threat_detection_policies.py => managed_server_security_alert_list_by_instance.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_database's_transparent_data_encryption.py => managed_transparent_data_encryption_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_list_of_the_database's_transparent_data_encryptions.py => managed_transparent_data_encryption_list.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_database's_transparent_data_encryption_state_with_minimal_parameters.py => managed_transparent_data_encryption_update.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{deletes_a_outbound_firewall_rule_with_a_given_name..py => outbound_firewall_rule_delete.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_outbound_firewall_rule..py => outbound_firewall_rule_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_list_of_outbound_firewall_rules_on_a_server..py => outbound_firewall_rule_list.py} (96%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/patch_database_default_enclave.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/patch_database_vbs_enclave.py rename sdk/sql/azure-mgmt-sql/generated_samples/{patch_an_instance_pool.py => patch_instance_pool.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{updates_a_database..py => patch_vcore_database.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{assigns_maintenance_window_to_a_database..py => patch_vcore_database_assign_maintenance_configuration.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{resets_maintenance_window_of_a_database_to_default..py => patch_vcore_database_reset_maintenance_configuration.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{pauses_a_database..py => pause_database.py} (94%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_delete.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_get.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_list.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_update.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_get.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_list.py rename sdk/sql/azure-mgmt-sql/generated_samples/{disables_sensitivity_recommendations_on_a_given_column.py => recommended_column_sensitivity_label_disable.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{enables_sensitivity_recommendations_on_a_given_column.py => recommended_column_sensitivity_label_enable.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_recoverable_database.py => recoverable_database_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_list_of_restorable_dropped_databases.py => recoverable_database_list.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{renames_a_database..py => rename_database.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_replication_link_on_server.py => replication_link_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{planned_failover_of_a_replication_link.py => replication_link_failover.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{forced_failover_of_a_replication_link.py => replication_link_failover_allow_data_loss.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_the_replication_link..py => replication_link_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_replication_links_on_server_on_database..py => replication_link_list_by_database.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_replication_links_on_server.py => replication_link_list_by_server.py} (97%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_copy.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_get.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_database.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_location.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_server.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_update.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_get.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_database.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_instance.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location.py rename sdk/sql/azure-mgmt-sql/generated_samples/{list_restorable_dropped_databases_by_managed_instances.py => restorable_dropped_managed_database_list_by_managed_instance.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{resumes_a_database..py => resume_database.py} (93%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_the_current_sensitivity_labels_of_a_given_database.py => sensitivity_labels_list_by_database_with_source_current.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_the_recommended_sensitivity_labels_of_a_given_database.py => sensitivity_labels_list_by_database_with_source_recommended.py} (95%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_server's_advanced_threat_protection_settings_with_all_parameters..py => server_advanced_threat_protection_settings_create_max.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_server's_advanced_threat_protection_settings_with_minimal_parameters..py => server_advanced_threat_protection_settings_create_min.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_server's_advanced_threat_protection_settings.py => server_advanced_threat_protection_settings_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_the_server's_advanced_threat_protection_settings..py => server_advanced_threat_protection_settings_list_by_server.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_server_advisor.py => server_advisor_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_of_server_advisors.py => server_advisor_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_server_advisor.py => server_advisor_update.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_auditing_settings_of_a_server.py => server_auditing_settings_list.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_server's_automatic_tuning_settings.py => server_automatic_tuning_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{updates_server_automatic_tuning_settings_with_all_properties.py => server_automatic_tuning_update_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{updates_server_automatic_tuning_settings_with_minimal_properties.py => server_automatic_tuning_update_min.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_server's_blob_auditing_policy_with_all_parameters.py => server_blob_auditing_create_max.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_server's_blob_auditing_policy_with_minimal_parameters.py => server_blob_auditing_create_min.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_server's_blob_auditing_policy.py => server_blob_auditing_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_server_communication_link.py => server_communication_link_create_or_update.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_a_server_communication_link.py => server_communication_link_delete.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_server_communication_link.py => server_communication_link_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_server_communication_links.py => server_communication_link_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_server_connection_policy.py => server_connection_policies_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{lists_a_servers_connection_policies.py => server_connection_policies_list.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{updates_a_server_connection_policy.py => server_connection_policies_update.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_server.py => server_create.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_server.py => server_delete.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_server's_dev_ops_audit_settings_with_all_params.py => server_dev_ops_audit_create_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_server's_dev_ops_audit_settings_with_minimal_input.py => server_dev_ops_audit_create_min.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_server's_dev_ops_audit_settings.py => server_dev_ops_audit_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_dev_ops_audit_settings_of_a_server.py => server_dev_ops_audit_list.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{acquire_server_dns_alias.py => server_dns_alias_acquire.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_server_dns_alias.py => server_dns_alias_create_or_update.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_server_dns_alias.py => server_dns_alias_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_server_dns_alias.py => server_dns_alias_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_server_dns_aliases.py => server_dns_alias_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_extended_auditing_settings_of_a_server.py => server_extended_auditing_settings_list.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_server.py => server_get.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_server_with_$expand=administrators.py => server_get_with_expand_equals_administrators.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{creates_or_updates_a_server_key.py => server_key_create_or_update.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_the_server_key.py => server_key_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_the_server_key.py => server_key_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_the_server_keys_by_server.py => server_key_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_servers.py => server_list.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_servers_by_resource_group.py => server_list_by_resource_group.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_servers_by_resource_group_with_$expand=administrators.py => server_list_by_resource_group_with_expand_equals_administrators.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_servers_with_expand_equals_administrators.py => server_list_with_expand_equals_administrators.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_of_server_recommended_actions_for_all_advisors.py => server_recommended_action_list_expand.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_server's_threat_detection_policy_with_all_parameters.py => server_security_alerts_create_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_server's_threat_detection_policy_with_minimal_parameters.py => server_security_alerts_create_min.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_server's_threat_detection_policy.py => server_security_alerts_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_the_server's_threat_detection_policies.py => server_security_alerts_list_by_server.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_server_trust_certificate..py => server_trust_certificates_create.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_server_trust_certificate..py => server_trust_certificates_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_server_trust_certificate..py => server_trust_certificates_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_list_of_server_trust_certificates_on_a_given_server..py => server_trust_certificates_list_by_instance.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_server_trust_group.py => server_trust_group_create.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{drop_server_trust_group.py => server_trust_group_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_server_trust_group.py => server_trust_group_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_server_trust_groups.py => server_trust_group_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_server_trust_groups_by_managed_instance.py => server_trust_group_list_by_managed_instance.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_server.py => server_update.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_servers_usages.py => server_usage_metrics_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py => server_vulnerability_assessment_create_container_sas_key_min.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_server's_vulnerability_assessment_with_all_parameters.py => server_vulnerability_assessment_create_max.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py => server_vulnerability_assessment_create_storage_access_key_min.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{remove_a_server's_vulnerability_assessment.py => server_vulnerability_assessment_delete.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_server's_vulnerability_assessment.py => server_vulnerability_assessment_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_server's_vulnerability_assessment_policies.py => server_vulnerability_assessment_list_by_server.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_service_objective.py => service_objective_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_service_objectives.py => service_objective_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_current_instance_sql_agent_configuration..py => sql_agent_configuration_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{puts_new_sql_agent_configuration_to_instance..py => sql_agent_configuration_put.py} (96%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add_latest.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_get.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_sql_vulnerability_assessment_policy.py => sql_vulnerability_assessment_create.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{remove_sql_vulnerability_assessment.py => sql_vulnerability_assessment_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_sql_vulnerability_assessment_policy.py => sql_vulnerability_assessment_get.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_sql_vulnerability_assessment_policies.py => sql_vulnerability_assessment_list_by_server.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_system_database_sql_vulnerability_assessment_scan_results_for_scan_id.py => sql_vulnerability_assessment_list_scans_results.py} (94%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_delete.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_get.py rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_system_database's_sql_vulnerability_assessment_rule_baseline..py => sql_vulnerability_assessment_rule_baseline_list_by_baseline.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_the_a_database_vulnerability_assessment_scan_records.py => sql_vulnerability_assessment_scan.py} (95%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_execute.py rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_system_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.py => sql_vulnerability_assessment_scans_results.py} (94%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_specific_subscription_usage_in_the_given_location..py => subscription_usage_get.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_subscription_usages_in_the_given_location..py => subscription_usage_list_by_location.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_all_synapselink_workspaces_for_the_given_database..py => synapse_link_workspace_list_by_database.py} (95%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_new_sync_agent.py => sync_agent_create.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_a_sync_agent.py => sync_agent_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{generate_a_sync_agent_key.py => sync_agent_generate_key.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_sync_agent.py => sync_agent_get.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_sync_agent_linked_databases.py => sync_agent_get_linked_databases.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_sync_agents_under_a_server.py => sync_agent_list_by_server.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_sync_agent.py => sync_agent_update.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{cancel_a_sync_group_synchronization.py => sync_group_cancel_sync.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_sync_group.py => sync_group_create.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_a_sync_group.py => sync_group_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_sync_group.py => sync_group_get.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_hub_database_schema..py => sync_group_get_hub_schema.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_sync_group_logs.py => sync_group_get_log.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_sync_database_id.py => sync_group_get_sync_database_id.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_sync_groups_under_a_given_database.py => sync_group_list_by_database.py} (96%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch.py rename sdk/sql/azure-mgmt-sql/generated_samples/{refresh_a_hub_database_schema..py => sync_group_refresh_hub_schema.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{trigger_a_sync_group_synchronization..py => sync_group_trigger_sync.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_sync_group.py => sync_group_update.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_a_new_sync_member.py => sync_member_create.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_a_sync_member.py => sync_member_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_sync_member.py => sync_member_get.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_sync_member_schema.py => sync_member_get_schema.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_sync_members_under_a_sync_group.py => sync_member_list_by_sync_group.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_an_existing_sync_member.py => sync_member_patch.py} (98%) rename sdk/sql/azure-mgmt-sql/generated_samples/{refresh_a_sync_member_database_schema.py => sync_member_refresh_schema.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_sync_member.py => sync_member_update.py} (98%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_get.py rename sdk/sql/azure-mgmt-sql/generated_samples/{get_a_list_of_the_database's_transparent_data_encryption.py => transparent_data_encryption_list.py} (95%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_update.py rename sdk/sql/azure-mgmt-sql/generated_samples/{update_a_job_agent's_tags..py => update_job_agent.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_the_short_term_retention_policy_for_the_database..py => update_managed_short_term_retention_policy.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_the_short_term_retention_policy_for_the_restorable_dropped_database..py => update_managed_short_term_retention_policy_restorable_dropped.py} (95%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/update_short_term_retention_policy.py rename sdk/sql/azure-mgmt-sql/generated_samples/{performs_update_of_dns_servers_on_managed_instance..py => update_virtual_cluster_dns_servers.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{upgrades_a_data_warehouse..py => upgrade_data_warehouse.py} (93%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_virtual_cluster.py => virtual_cluster_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_virtual_cluster.py => virtual_cluster_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_virtual_clusters.py => virtual_cluster_list.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_virtual_clusters_by_resource_group.py => virtual_cluster_list_by_resource_group.py} (96%) rename sdk/sql/azure-mgmt-sql/generated_samples/{update_virtual_cluster_with_tags.py => virtual_cluster_update.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{create_or_update_a_virtual_network_rule.py => virtual_network_rules_create_or_update.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{delete_a_virtual_network_rule.py => virtual_network_rules_delete.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{gets_a_virtual_network_rule.py => virtual_network_rules_get.py} (97%) rename sdk/sql/azure-mgmt-sql/generated_samples/{list_virtual_network_rules.py => virtual_network_rules_list.py} (97%) diff --git a/sdk/sql/azure-mgmt-sql/_meta.json b/sdk/sql/azure-mgmt-sql/_meta.json index ce0a8b7fd7f0..13085d077ec2 100644 --- a/sdk/sql/azure-mgmt-sql/_meta.json +++ b/sdk/sql/azure-mgmt-sql/_meta.json @@ -1,11 +1,11 @@ { - "commit": "8a20cee044fafde7ae0364edab45a577aa80d20f", + "commit": "f20c8fce685cff482afb864043175e5d806f02c2", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.1", + "@autorest/python@6.2.7", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/sql/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/sql/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/sql/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/__init__.py index 2bf6ccd2d152..5de83eadd832 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk 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 e87ddb448728..3a167186aac7 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_configuration.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_configuration.py @@ -44,10 +44,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-sql/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_serialization.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_serialization.py index 7c1dedb5133d..2c170e28dbca 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_serialization.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_serialization.py @@ -25,6 +25,7 @@ # -------------------------------------------------------------------------- # pylint: skip-file +# pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode import calendar @@ -37,24 +38,22 @@ import re import sys import codecs +from typing import Optional, Union, AnyStr, IO, Mapping try: from urllib import quote # type: ignore except ImportError: - from urllib.parse import quote # type: ignore + from urllib.parse import quote import xml.etree.ElementTree as ET -import isodate +import isodate # type: ignore -from typing import Dict, Any, cast, TYPE_CHECKING +from typing import Dict, Any, cast from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -if TYPE_CHECKING: - from typing import Optional, Union, AnyStr, IO, Mapping - class RawDeserializer: @@ -65,8 +64,7 @@ class RawDeserializer: CONTEXT_NAME = "deserialized_data" @classmethod - def deserialize_from_text(cls, data, content_type=None): - # type: (Optional[Union[AnyStr, IO]], Optional[str]) -> Any + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: """Decode data according to content-type. Accept a stream of data as well, but will be load at once in memory for now. @@ -132,8 +130,7 @@ def _json_attemp(data): raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) @classmethod - def deserialize_from_http_generics(cls, body_bytes, headers): - # type: (Optional[Union[AnyStr, IO]], Mapping) -> Any + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: """Deserialize from HTTP response. Use bytes and headers to NOT use any requests/aiohttp or whatever @@ -160,8 +157,8 @@ def deserialize_from_http_generics(cls, body_bytes, headers): basestring # type: ignore unicode_str = unicode # type: ignore except NameError: - basestring = str # type: ignore - unicode_str = str # type: ignore + basestring = str + unicode_str = str _LOGGER = logging.getLogger(__name__) @@ -188,7 +185,7 @@ def dst(self, dt): try: - from datetime import timezone as _FixedOffset + from datetime import timezone as _FixedOffset # type: ignore except ImportError: # Python 2.7 class _FixedOffset(datetime.tzinfo): # type: ignore @@ -219,7 +216,7 @@ def __getinitargs__(self): try: from datetime import timezone - TZ_UTC = timezone.utc # type: ignore + TZ_UTC = timezone.utc except ImportError: TZ_UTC = UTC() # type: ignore @@ -276,9 +273,9 @@ class Model(object): serialization and deserialization. """ - _subtype_map = {} # type: Dict[str, Dict[str, Any]] - _attribute_map = {} # type: Dict[str, Dict[str, Any]] - _validation = {} # type: Dict[str, Dict[str, Any]] + _subtype_map: Dict[str, Dict[str, Any]] = {} + _attribute_map: Dict[str, Dict[str, Any]] = {} + _validation: Dict[str, Dict[str, Any]] = {} def __init__(self, **kwargs): self.additional_properties = {} @@ -310,7 +307,7 @@ def enable_additional_properties_sending(cls): @classmethod def is_xml_model(cls): try: - cls._xml_map + cls._xml_map # type: ignore except AttributeError: return False return True @@ -319,7 +316,7 @@ def is_xml_model(cls): def _create_xml_node(cls): """Create XML node.""" try: - xml_map = cls._xml_map + xml_map = cls._xml_map # type: ignore except AttributeError: xml_map = {} @@ -453,7 +450,7 @@ def _classify(cls, response, objects): return cls flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) try: - return objects[flatten_mapping_type[subtype_value]] + return objects[flatten_mapping_type[subtype_value]] # type: ignore except KeyError: _LOGGER.warning( "Subtype value %s has no mapping, use base class %s.", @@ -606,13 +603,13 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) xml_name = "{}{}".format(xml_ns, xml_name) - serialized.set(xml_name, new_attr) + serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): - serialized.text = new_attr + serialized.text = new_attr # type: ignore continue if isinstance(new_attr, list): - serialized.extend(new_attr) + serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): @@ -621,23 +618,23 @@ def _serialize(self, target_obj, data_type=None, **kwargs): new_attr.tag = "}".join([splitted_tag[0], xml_name]) else: new_attr.tag = xml_name - serialized.append(new_attr) + serialized.append(new_attr) # type: ignore else: # That's a basic type # Integrate namespace if necessary local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) local_node.text = unicode_str(new_attr) - serialized.append(local_node) + serialized.append(local_node) # type: ignore else: # JSON - for k in reversed(keys): + for k in reversed(keys): # type: ignore unflattened = {k: new_attr} new_attr = unflattened _new_attr = new_attr _serialized = serialized - for k in keys: + for k in keys: # type: ignore if k not in _serialized: - _serialized.update(_new_attr) - _new_attr = _new_attr[k] + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] except ValueError: continue @@ -675,7 +672,7 @@ def body(self, data, data_type, **kwargs): # We're not able to deal with additional properties for now. deserializer.additional_properties_detection = False if is_xml_model_serialization: - deserializer.key_extractors = [ + deserializer.key_extractors = [ # type: ignore attribute_key_case_insensitive_extractor, ] else: @@ -843,7 +840,7 @@ def serialize_unicode(cls, data): pass try: - if isinstance(data, unicode): + if isinstance(data, unicode): # type: ignore # Don't change it, JSON and XML ElementTree are totally able # to serialize correctly u'' strings return data @@ -1001,10 +998,10 @@ def serialize_enum(attr, enum_obj=None): except AttributeError: result = attr try: - enum_obj(result) + enum_obj(result) # type: ignore return result except ValueError: - for enum_value in enum_obj: + for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" @@ -1416,7 +1413,7 @@ def _deserialize(self, target_obj, data): if data is None: return data try: - attributes = response._attribute_map + attributes = response._attribute_map # type: ignore d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1444,7 +1441,7 @@ def _deserialize(self, target_obj, data): value = self.deserialize_data(raw_value, attr_desc["type"]) d_attrs[attr] = value except (AttributeError, TypeError, KeyError) as err: - msg = "Unable to deserialize to object: " + class_name + msg = "Unable to deserialize to object: " + class_name # type: ignore raise_with_traceback(DeserializationError, msg, err) else: additional_properties = self._build_additional_properties(attributes, data) @@ -1543,7 +1540,7 @@ def _unpack_content(raw_data, content_type=None): return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): - return RawDeserializer.deserialize_from_text(raw_data, content_type) + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore return raw_data def _instantiate_model(self, response, attrs, additional_properties=None): @@ -1565,7 +1562,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None): response_obj.additional_properties = additional_properties return response_obj except TypeError as err: - msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore raise DeserializationError(msg + str(err)) else: try: @@ -1747,7 +1744,7 @@ def deserialize_unicode(data): # Consider this is real string try: - if isinstance(data, unicode): + if isinstance(data, unicode): # type: ignore return data except NameError: return str(data) @@ -1798,7 +1795,7 @@ def deserialize_bytearray(attr): """ if isinstance(attr, ET.Element): attr = attr.text - return bytearray(b64decode(attr)) + return bytearray(b64decode(attr)) # type: ignore @staticmethod def deserialize_base64(attr): @@ -1810,8 +1807,8 @@ def deserialize_base64(attr): """ if isinstance(attr, ET.Element): attr = attr.text - padding = "=" * (3 - (len(attr) + 3) % 4) - attr = attr + padding + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore encoded = attr.replace("-", "+").replace("_", "/") return b64decode(encoded) @@ -1826,7 +1823,7 @@ def deserialize_decimal(attr): if isinstance(attr, ET.Element): attr = attr.text try: - return decimal.Decimal(attr) + return decimal.Decimal(attr) # type: ignore except decimal.DecimalException as err: msg = "Invalid decimal {}".format(attr) raise_with_traceback(DeserializationError, msg, err) @@ -1841,7 +1838,7 @@ def deserialize_long(attr): """ if isinstance(attr, ET.Element): attr = attr.text - return _long_type(attr) + return _long_type(attr) # type: ignore @staticmethod def deserialize_duration(attr): @@ -1871,7 +1868,7 @@ def deserialize_date(attr): """ if isinstance(attr, ET.Element): attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. return isodate.parse_date(attr, defaultmonth=None, defaultday=None) @@ -1886,7 +1883,7 @@ def deserialize_time(attr): """ if isinstance(attr, ET.Element): attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) return isodate.parse_time(attr) @@ -1901,7 +1898,7 @@ def deserialize_rfc(attr): if isinstance(attr, ET.Element): attr = attr.text try: - parsed_date = email.utils.parsedate_tz(attr) + parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) @@ -1924,7 +1921,7 @@ def deserialize_iso(attr): if isinstance(attr, ET.Element): attr = attr.text try: - attr = attr.upper() + attr = attr.upper() # type: ignore match = Deserializer.valid_date.match(attr) if not match: raise ValueError("Invalid datetime string: " + attr) @@ -1960,7 +1957,7 @@ def deserialize_unix(attr): :raises: DeserializationError if format invalid """ if isinstance(attr, ET.Element): - attr = int(attr.text) + attr = int(attr.text) # type: ignore try: date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) except ValueError as err: 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 88aaeedbc59a..0fa429da8c90 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 @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from ._configuration import SqlManagementClientConfiguration from ._serialization import Deserializer, Serializer from .operations import ( @@ -598,7 +598,7 @@ def __init__( ) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + 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.client_side_validation = False @@ -1016,15 +1016,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SqlManagementClient + def __enter__(self) -> "SqlManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) 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 1e4f07ee570f..c78e629b6f08 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "4.0.0b5" +VERSION = "0.9.0" 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 a1456e6ead0b..ae0c78dc1ab2 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 @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py index 7f5364616f0a..b276f0d214d9 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 @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SqlManagementClientConfiguration from .operations import ( @@ -604,7 +604,7 @@ def __init__( ) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + 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.client_side_validation = False 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 f6785e094a7f..6f4b420e6fd9 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 @@ -183,7 +183,7 @@ from ._virtual_clusters_operations import VirtualClustersOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ 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 cd4532004062..84c7536e6327 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 @@ -100,10 +100,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupShortTermRetentionPolicy] + ) + cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -117,9 +117,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -136,7 +136,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } async def _create_or_update_initial( self, @@ -158,11 +160,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -187,9 +189,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -208,7 +210,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @overload async def begin_create_or_update( @@ -340,16 +344,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupShortTermRetentionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -371,7 +375,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -383,9 +387,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } async def _update_initial( self, @@ -407,11 +413,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -436,9 +442,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -457,7 +463,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @overload async def begin_update( @@ -589,16 +597,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupShortTermRetentionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -620,7 +628,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -632,9 +640,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_database( @@ -659,10 +669,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupShortTermRetentionPolicyListResult] + ) + cls: ClsType[_models.BackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -686,12 +696,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -699,13 +709,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -718,4 +728,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies" + } 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 2c6b510335b6..c89a7b62560e 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 @@ -84,10 +84,10 @@ async def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LocationCapabilities] + ) + cls: ClsType[_models.LocationCapabilities] = kwargs.pop("cls", None) request = build_list_by_location_request( location_name=location_name, @@ -99,9 +99,9 @@ async def list_by_location( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -118,4 +118,6 @@ async def list_by_location( return deserialized - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/capabilities"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/capabilities" + } 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 6d19f1b3c3ee..794f0634584f 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 @@ -169,10 +169,10 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataMaskingPolicy] + api_version: Literal["2014-04-01"] = 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)) + cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -197,9 +197,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -216,7 +216,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}" + } @distributed_trace_async async def get( @@ -251,9 +253,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataMaskingPolicy] + api_version: Literal["2014-04-01"] = 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, @@ -267,9 +269,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -286,4 +288,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}" + } 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 f97fd617146c..c760c8c07dee 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 @@ -182,10 +182,10 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataMaskingRule] + api_version: Literal["2014-04-01"] = 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)) + cls: ClsType[_models.DataMaskingRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -211,9 +211,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -230,11 +230,13 @@ async def create_or_update( deserialized = self._deserialize("DataMaskingRule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}" + } @distributed_trace def list_by_database( @@ -261,9 +263,9 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataMaskingRuleListResult] + api_version: Literal["2014-04-01"] = 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 = { 401: ClientAuthenticationError, @@ -288,12 +290,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -301,13 +303,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -320,4 +322,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules" + } 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 bc00fbabd1e8..432609ae60b2 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 @@ -95,10 +95,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataWarehouseUserActivities] + ) + cls: ClsType[_models.DataWarehouseUserActivities] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -112,9 +112,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -131,7 +131,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}" + } @distributed_trace def list_by_database( @@ -156,10 +158,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataWarehouseUserActivitiesListResult] + ) + cls: ClsType[_models.DataWarehouseUserActivitiesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -183,12 +185,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -196,13 +198,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -215,4 +217,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities" + } 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 b1d34b06c220..19ff93a116e3 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 @@ -84,10 +84,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAdvancedThreatProtectionListResult] + ) + cls: ClsType[_models.DatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,12 +111,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -124,13 +124,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -143,7 +143,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings" + } @distributed_trace_async async def get( @@ -183,10 +185,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAdvancedThreatProtection] + ) + cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -200,9 +202,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -219,7 +221,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } @overload async def create_or_update( @@ -338,11 +342,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAdvancedThreatProtection] + ) + 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 @@ -367,9 +371,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -386,8 +390,10 @@ async def create_or_update( deserialized = self._deserialize("DatabaseAdvancedThreatProtection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } 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 234f74971bde..d50a1e2bdaca 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 @@ -95,10 +95,10 @@ async def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[List[_models.Advisor]] + ) + cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) request = build_list_by_database_request( resource_group_name=resource_group_name, @@ -112,9 +112,9 @@ async def list_by_database( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -131,7 +131,9 @@ async def list_by_database( return deserialized - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors" + } @distributed_trace_async async def get( @@ -164,10 +166,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Advisor] + ) + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -181,9 +183,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -200,7 +202,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}" + } @overload async def update( @@ -313,11 +317,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Advisor] + ) + 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 @@ -342,9 +346,9 @@ async def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -361,4 +365,6 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}" + } 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 d260e763ca4a..85f86315a1d6 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 @@ -84,10 +84,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAutomaticTuning] + ) + cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -100,9 +100,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -119,7 +119,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current" + } @overload async def update( @@ -223,11 +225,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAutomaticTuning] + ) + 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 @@ -251,9 +253,9 @@ async def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -270,4 +272,6 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current" + } 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 b9cfff447085..80b4a994d2be 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 @@ -84,10 +84,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseBlobAuditingPolicyListResult] + ) + cls: ClsType[_models.DatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,12 +111,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -124,13 +124,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -143,7 +143,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings" + } @distributed_trace_async async def get( @@ -177,11 +179,11 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseBlobAuditingPolicy] + ) + cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -195,9 +197,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -214,7 +216,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}" + } @overload async def create_or_update( @@ -327,12 +331,12 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseBlobAuditingPolicy] + ) + 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 @@ -357,9 +361,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -376,8 +380,10 @@ async def create_or_update( deserialized = self._deserialize("DatabaseBlobAuditingPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}" + } 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 315c22ce8d78..a4ec4f9aa945 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 @@ -102,10 +102,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumnListResult] + ) + cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -134,12 +134,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -147,13 +147,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -166,7 +166,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/columns"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/columns" + } @distributed_trace def list_by_table( @@ -203,10 +205,10 @@ def list_by_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumnListResult] + ) + cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -233,12 +235,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -246,13 +248,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -265,7 +267,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns"} # type: ignore + list_by_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns" + } @distributed_trace_async async def get( @@ -309,10 +313,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumn] + ) + cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -328,9 +332,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -347,4 +351,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}" + } 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 d35775bac591..4dcadbb5eb61 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 @@ -94,10 +94,10 @@ async def get( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -111,9 +111,9 @@ async def get( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -126,7 +126,9 @@ async def get( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}" + } async def _create_or_update_initial( self, @@ -148,11 +150,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ImportExportExtensionsOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ImportExportExtensionsOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -177,9 +179,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -198,7 +200,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}" + } @overload async def begin_create_or_update( @@ -330,16 +334,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportExtensionsOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -361,7 +365,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -373,9 +377,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}" + } @distributed_trace def list_by_database( @@ -400,10 +406,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportExtensionsOperationListResult] + ) + cls: ClsType[_models.ImportExportExtensionsOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -427,12 +433,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -440,13 +446,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -459,4 +465,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions" + } 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 30c0384e93a4..a324f4f1ba66 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 @@ -88,10 +88,10 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -105,9 +105,9 @@ async def cancel( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -120,7 +120,9 @@ async def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations/{operationId}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations/{operationId}/cancel" + } @distributed_trace def list_by_database( @@ -143,10 +145,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseOperationListResult] + ) + cls: ClsType[_models.DatabaseOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -170,12 +172,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -183,13 +185,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -202,4 +204,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations" + } 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 7ce942b0d150..e6b06562b1b1 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 @@ -90,10 +90,10 @@ async def list_by_database_advisor( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[List[_models.RecommendedAction]] + ) + cls: ClsType[List[_models.RecommendedAction]] = kwargs.pop("cls", None) request = build_list_by_database_advisor_request( resource_group_name=resource_group_name, @@ -107,9 +107,9 @@ async def list_by_database_advisor( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -126,7 +126,9 @@ async def list_by_database_advisor( return deserialized - list_by_database_advisor.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions"} # type: ignore + list_by_database_advisor.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions" + } @distributed_trace_async async def get( @@ -167,10 +169,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecommendedAction] + ) + cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -185,9 +187,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -204,7 +206,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}" + } @overload async def update( @@ -326,11 +330,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecommendedAction] + ) + 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" _json = None @@ -356,9 +360,9 @@ async def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -375,4 +379,6 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}" + } 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 ee8f7260286a..fad1bcb15f02 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 @@ -86,10 +86,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSchemaListResult] + ) + cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -114,12 +114,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -127,13 +127,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -146,7 +146,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas" + } @distributed_trace_async async def get( @@ -179,10 +181,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSchema] + ) + cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -196,9 +198,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -215,4 +217,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}" + } 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 31381e6a4bbb..76d77c1f4ae4 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 @@ -98,10 +98,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSecurityAlertPolicy] + ) + cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -115,9 +115,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -134,7 +134,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + } @overload async def create_or_update( @@ -250,11 +252,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSecurityAlertPolicy] + ) + 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 @@ -279,9 +281,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -298,11 +300,13 @@ async def create_or_update( deserialized = self._deserialize("DatabaseSecurityAlertPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + } @distributed_trace def list_by_database( @@ -328,10 +332,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSecurityAlertListResult] + ) + cls: ClsType[_models.DatabaseSecurityAlertListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -355,12 +359,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -368,13 +372,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -387,4 +391,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies" + } 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 a246a9125c03..60f64db0bd1a 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 @@ -92,10 +92,10 @@ def list_by_sql_vulnerability_assessment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -120,12 +120,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -135,13 +135,13 @@ async def extract_data(pipeline_response): ) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -154,7 +154,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_sql_vulnerability_assessment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines"} # type: ignore + list_by_sql_vulnerability_assessment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines" + } @distributed_trace_async async def get( @@ -196,10 +198,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -214,9 +216,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -233,7 +235,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + } @overload async def create_or_update( @@ -360,11 +364,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + ) + 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 @@ -390,9 +394,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -409,4 +413,6 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + } 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 5f0b9bbed80e..65a22237843e 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 @@ -76,10 +76,10 @@ async def _execute_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_execute_request( resource_group_name=resource_group_name, @@ -93,9 +93,9 @@ async def _execute_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -108,7 +108,9 @@ async def _execute_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _execute_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan"} # type: ignore + _execute_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + } @distributed_trace_async async def begin_execute( @@ -146,13 +148,13 @@ async def begin_execute( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._execute_initial( # type: ignore resource_group_name=resource_group_name, @@ -172,7 +174,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -184,6 +186,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_execute.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan"} # type: ignore + begin_execute.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + } 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 f501b767f6d1..9eef3f965243 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 @@ -96,10 +96,10 @@ def list_by_baseline( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -125,12 +125,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -140,13 +140,13 @@ async def extract_data(pipeline_response): ) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -159,7 +159,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_baseline.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules"} # type: ignore + list_by_baseline.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules" + } @distributed_trace_async async def get( @@ -204,10 +206,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -223,9 +225,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -242,7 +244,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } @overload async def create_or_update( @@ -377,11 +381,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + ) + 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 @@ -408,9 +412,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -427,7 +431,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -472,10 +478,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -491,9 +497,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -506,4 +512,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } 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 a8fd42d5f736..fde1419788f2 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 @@ -96,10 +96,10 @@ def list_by_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] + ) + cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -125,12 +125,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -138,13 +138,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -157,7 +157,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_scan.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults"} # type: ignore + list_by_scan.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults" + } @distributed_trace_async async def get( @@ -204,10 +206,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanResults] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -223,9 +225,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -242,4 +244,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}" + } 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 73bcd0631e8c..27864bf6c9d7 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 @@ -91,10 +91,10 @@ def list_by_sql_vulnerability_assessments( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -119,12 +119,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -132,13 +132,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -151,7 +151,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_sql_vulnerability_assessments.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans"} # type: ignore + list_by_sql_vulnerability_assessments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + } @distributed_trace_async async def get( @@ -193,10 +195,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -211,9 +213,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -230,4 +232,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + } 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 65fc3a7c09a7..861d25766058 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 @@ -83,10 +83,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -123,13 +123,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments" + } @distributed_trace_async async def get( @@ -182,10 +184,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessment] + ) + cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -199,9 +201,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -218,4 +220,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + } 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 31c7695fa5e2..518fe561c410 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 @@ -89,10 +89,10 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseTableListResult] + ) + cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -118,12 +118,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -131,13 +131,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -150,7 +150,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_schema.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables"} # type: ignore + list_by_schema.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables" + } @distributed_trace_async async def get( @@ -191,10 +193,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseTable] + ) + cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -209,9 +211,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -228,4 +230,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}" + } 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 d5674dffa20c..390d0315b5b9 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 @@ -77,10 +77,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseUsageListResult] + ) + cls: ClsType[_models.DatabaseUsageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -104,12 +104,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -117,13 +117,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -136,4 +136,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/usages"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/usages" + } 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 322b95b3f399..89adc592ca6a 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 @@ -105,10 +105,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -124,9 +124,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -143,7 +143,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } @overload async def create_or_update( @@ -286,11 +288,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] + ) + 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 @@ -317,9 +319,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -336,7 +338,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -384,10 +388,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -403,9 +407,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -418,4 +422,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } 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 7ea26b43eb03..cfafef8928a1 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 @@ -84,10 +84,10 @@ async def _initiate_scan_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_initiate_scan_request( resource_group_name=resource_group_name, @@ -102,9 +102,9 @@ async def _initiate_scan_initial( # pylint: disable=inconsistent-return-stateme params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -117,7 +117,9 @@ async def _initiate_scan_initial( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - _initiate_scan_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan"} # type: ignore + _initiate_scan_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + } @distributed_trace_async async def begin_initiate_scan( @@ -158,13 +160,13 @@ async def begin_initiate_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._initiate_scan_initial( # type: ignore resource_group_name=resource_group_name, @@ -185,7 +187,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -197,9 +199,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_initiate_scan.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan"} # type: ignore + begin_initiate_scan.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + } @distributed_trace def list_by_database( @@ -232,10 +236,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] + ) + cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -260,12 +264,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -273,13 +277,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -292,7 +296,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + } @distributed_trace_async async def get( @@ -334,10 +340,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VulnerabilityAssessmentScanRecord] + ) + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -352,9 +358,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -371,7 +377,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + } @distributed_trace_async async def export( @@ -413,10 +421,10 @@ async def export( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) request = build_export_request( resource_group_name=resource_group_name, @@ -431,9 +439,9 @@ async def export( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -450,8 +458,10 @@ async def export( deserialized = self._deserialize("DatabaseVulnerabilityAssessmentScansExport", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - export.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export"} # type: ignore + export.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export" + } 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 6047cdd8db3d..f317a7c33e2c 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 @@ -100,10 +100,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessment] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -117,9 +117,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -136,7 +136,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload async def create_or_update( @@ -254,11 +256,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessment] + ) + 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 @@ -283,9 +285,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -302,11 +304,13 @@ async def create_or_update( deserialized = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -346,10 +350,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -363,9 +367,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -378,7 +382,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def list_by_database( @@ -404,10 +410,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -431,12 +437,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -444,13 +450,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -463,4 +469,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments" + } 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 91bcf2d15cdc..e499327871f2 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 @@ -100,8 +100,8 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -126,12 +126,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -139,13 +139,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -158,7 +158,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics" + } @distributed_trace def list_metric_definitions( @@ -181,8 +183,8 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -206,12 +208,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -219,13 +221,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -238,7 +240,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions" + } @distributed_trace def list_by_server( @@ -261,10 +265,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseListResult] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -288,12 +292,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -301,13 +305,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -320,7 +324,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases" + } @distributed_trace_async async def get( @@ -351,10 +357,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.Database] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -367,9 +373,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -386,7 +392,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } async def _create_or_update_initial( self, @@ -407,11 +415,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Database]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -435,9 +443,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -459,7 +467,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } @overload async def begin_create_or_update( @@ -579,16 +589,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -609,7 +619,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -621,9 +631,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -639,10 +651,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -655,9 +667,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -670,7 +682,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } @distributed_trace_async async def begin_delete( @@ -700,13 +714,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -725,7 +739,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -737,9 +751,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } async def _update_initial( self, @@ -760,11 +776,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Database]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -788,9 +804,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -809,7 +825,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } @overload async def begin_update( @@ -929,16 +947,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -959,7 +977,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -971,9 +989,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } async def _export_initial( self, @@ -994,11 +1014,11 @@ async def _export_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ImportExportOperationResult]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1022,9 +1042,9 @@ async def _export_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1043,7 +1063,9 @@ async def _export_initial( return deserialized - _export_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export"} # type: ignore + _export_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export" + } @overload async def begin_export( @@ -1163,16 +1185,16 @@ async def begin_export( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._export_initial( # type: ignore + raw_result = await self._export_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1193,7 +1215,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1205,9 +1227,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_export.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export"} # type: ignore + begin_export.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export" + } async def _failover_initial( # pylint: disable=inconsistent-return-statements self, @@ -1228,10 +1252,10 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -1245,9 +1269,9 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1260,7 +1284,9 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover" + } @distributed_trace_async async def begin_failover( @@ -1298,13 +1324,13 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._failover_initial( # type: ignore resource_group_name=resource_group_name, @@ -1324,7 +1350,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1336,9 +1362,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover" + } async def _import_method_initial( self, @@ -1359,11 +1387,11 @@ async def _import_method_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ImportExportOperationResult]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1387,9 +1415,9 @@ async def _import_method_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1408,7 +1436,9 @@ async def _import_method_initial( return deserialized - _import_method_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import"} # type: ignore + _import_method_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import" + } @overload async def begin_import_method( @@ -1528,16 +1558,16 @@ async def begin_import_method( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._import_method_initial( # type: ignore + raw_result = await self._import_method_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1558,7 +1588,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1570,9 +1600,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_import_method.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import"} # type: ignore + begin_import_method.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import" + } @overload async def rename( # pylint: disable=inconsistent-return-statements @@ -1676,11 +1708,11 @@ async 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-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 @@ -1704,9 +1736,9 @@ async def rename( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1719,7 +1751,9 @@ async def rename( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - rename.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/move"} # type: ignore + rename.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/move" + } async def _pause_initial( self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -1735,10 +1769,10 @@ async def _pause_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Database]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) request = build_pause_request( resource_group_name=resource_group_name, @@ -1751,9 +1785,9 @@ async def _pause_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1772,7 +1806,9 @@ async def _pause_initial( return deserialized - _pause_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause"} # type: ignore + _pause_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause" + } @distributed_trace_async async def begin_pause( @@ -1803,15 +1839,15 @@ async def begin_pause( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._pause_initial( # type: ignore + raw_result = await self._pause_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1830,7 +1866,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1842,9 +1878,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause"} # type: ignore + begin_pause.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause" + } async def _resume_initial( self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -1860,10 +1898,10 @@ async def _resume_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Database]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) request = build_resume_request( resource_group_name=resource_group_name, @@ -1876,9 +1914,9 @@ async def _resume_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1897,7 +1935,9 @@ async def _resume_initial( return deserialized - _resume_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume"} # type: ignore + _resume_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume" + } @distributed_trace_async async def begin_resume( @@ -1928,15 +1968,15 @@ async def begin_resume( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._resume_initial( # type: ignore + raw_result = await self._resume_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1955,7 +1995,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1967,9 +2007,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume"} # type: ignore + begin_resume.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume" + } async def _upgrade_data_warehouse_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -1985,10 +2027,10 @@ async def _upgrade_data_warehouse_initial( # pylint: disable=inconsistent-retur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_upgrade_data_warehouse_request( resource_group_name=resource_group_name, @@ -2001,9 +2043,9 @@ async def _upgrade_data_warehouse_initial( # pylint: disable=inconsistent-retur params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2016,7 +2058,9 @@ async def _upgrade_data_warehouse_initial( # pylint: disable=inconsistent-retur if cls: return cls(pipeline_response, None, {}) - _upgrade_data_warehouse_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse"} # type: ignore + _upgrade_data_warehouse_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse" + } @distributed_trace_async async def begin_upgrade_data_warehouse( @@ -2046,13 +2090,13 @@ async def begin_upgrade_data_warehouse( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._upgrade_data_warehouse_initial( # type: ignore resource_group_name=resource_group_name, @@ -2071,7 +2115,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -2083,9 +2127,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_upgrade_data_warehouse.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse"} # type: ignore + begin_upgrade_data_warehouse.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse" + } @distributed_trace def list_by_elastic_pool( @@ -2108,10 +2154,10 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseListResult] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2135,12 +2181,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2148,13 +2194,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2167,7 +2213,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_elastic_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases"} # type: ignore + list_by_elastic_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases" + } @distributed_trace def list_inaccessible_by_server( @@ -2188,10 +2236,10 @@ def list_inaccessible_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseListResult] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2214,12 +2262,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2227,13 +2275,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2246,4 +2294,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_inaccessible_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/inaccessibleDatabases"} # type: ignore + list_inaccessible_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/inaccessibleDatabases" + } 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 03b5c41405a0..4133f263741a 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 @@ -76,10 +76,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DeletedServer"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeletedServerListResult] + ) + cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -100,12 +100,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -113,13 +113,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -132,7 +132,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/deletedServers"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/deletedServers"} @distributed_trace_async async def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _models.DeletedServer: @@ -158,10 +158,10 @@ async def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeletedServer] + ) + cls: ClsType[_models.DeletedServer] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -173,9 +173,9 @@ async def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -192,7 +192,9 @@ async def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}" + } @distributed_trace def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncIterable["_models.DeletedServer"]: @@ -208,10 +210,10 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncIterable[" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeletedServerListResult] + ) + cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -233,12 +235,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -246,13 +248,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -265,7 +267,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers" + } async def _recover_initial( self, location_name: str, deleted_server_name: str, **kwargs: Any @@ -281,10 +285,10 @@ async def _recover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DeletedServer]] + ) + cls: ClsType[Optional[_models.DeletedServer]] = kwargs.pop("cls", None) request = build_recover_request( location_name=location_name, @@ -296,9 +300,9 @@ async def _recover_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -317,7 +321,9 @@ async def _recover_initial( return deserialized - _recover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover"} # type: ignore + _recover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover" + } @distributed_trace_async async def begin_recover( @@ -345,15 +351,15 @@ async def begin_recover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeletedServer] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._recover_initial( # type: ignore + raw_result = await self._recover_initial( location_name=location_name, deleted_server_name=deleted_server_name, api_version=api_version, @@ -371,7 +377,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -383,6 +389,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_recover.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover"} # type: ignore + begin_recover.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover" + } 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 7e5c10156509..37fadfa572c8 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 @@ -86,10 +86,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DistributedAvailabilityGroupsListResult] + ) + cls: ClsType[_models.DistributedAvailabilityGroupsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -112,12 +112,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -125,13 +125,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -144,7 +144,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups" + } @distributed_trace_async async def get( @@ -179,10 +181,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DistributedAvailabilityGroup] + ) + cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -195,9 +197,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -214,7 +216,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } async def _create_or_update_initial( self, @@ -235,11 +239,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DistributedAvailabilityGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -263,9 +267,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -287,7 +291,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } @overload async def begin_create_or_update( @@ -407,16 +413,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DistributedAvailabilityGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + 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, @@ -437,7 +443,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -449,9 +455,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -471,10 +479,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -487,9 +495,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -502,7 +510,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } @distributed_trace_async async def begin_delete( @@ -536,13 +546,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -561,7 +571,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -573,9 +583,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } async def _update_initial( self, @@ -596,11 +608,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DistributedAvailabilityGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -624,9 +636,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -645,7 +657,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } @overload async def begin_update( @@ -765,16 +779,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DistributedAvailabilityGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + 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, @@ -795,7 +809,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -807,6 +821,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_activities_operations.py index 7b33f6df7dc7..6955774e4ebf 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_activities_operations.py @@ -78,8 +78,8 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPoolActivityListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ElasticPoolActivityListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -103,12 +103,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -116,13 +116,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -135,4 +135,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_elastic_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity"} # type: ignore + list_by_elastic_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_database_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_database_activities_operations.py index ca2ab47408af..621fa11b3182 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_database_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_database_activities_operations.py @@ -79,8 +79,8 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPoolDatabaseActivityListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ElasticPoolDatabaseActivityListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -104,12 +104,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -117,13 +117,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -136,4 +136,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_elastic_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity"} # type: ignore + list_by_elastic_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity" + } 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 3893b526480a..a44d67eca5b8 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 @@ -88,10 +88,10 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -105,9 +105,9 @@ async def cancel( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -120,7 +120,9 @@ async def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/cancel" + } @distributed_trace def list_by_elastic_pool( @@ -144,10 +146,10 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPoolOperationListResult] + ) + cls: ClsType[_models.ElasticPoolOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -171,12 +173,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -184,13 +186,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -203,4 +205,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_elastic_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations"} # type: ignore + list_by_elastic_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations" + } 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 4bc8385ba762..69d3e8512e43 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 @@ -92,8 +92,8 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -118,12 +118,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -131,13 +131,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -150,7 +150,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics" + } @distributed_trace def list_metric_definitions( @@ -173,8 +175,8 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -198,12 +200,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -211,13 +213,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -230,7 +232,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions" + } @distributed_trace def list_by_server( @@ -253,10 +257,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPoolListResult] + ) + cls: ClsType[_models.ElasticPoolListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -280,12 +284,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -293,13 +297,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -312,7 +316,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools" + } @distributed_trace_async async def get( @@ -343,10 +349,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPool] + ) + cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -359,9 +365,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -378,7 +384,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } async def _create_or_update_initial( self, @@ -399,11 +407,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ElasticPool]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ElasticPool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -427,9 +435,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -451,7 +459,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } @overload async def begin_create_or_update( @@ -570,16 +580,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPool] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, elastic_pool_name=elastic_pool_name, @@ -600,7 +610,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -612,9 +622,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any @@ -630,10 +642,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -646,9 +658,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -661,7 +673,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } @distributed_trace_async async def begin_delete( @@ -691,13 +705,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -716,7 +730,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -728,9 +742,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } async def _update_initial( self, @@ -751,11 +767,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ElasticPool]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ElasticPool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -779,9 +795,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -800,7 +816,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } @overload async def begin_update( @@ -920,16 +938,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPool] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, server_name=server_name, elastic_pool_name=elastic_pool_name, @@ -950,7 +968,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -962,9 +980,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } async def _failover_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any @@ -980,10 +1000,10 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -996,9 +1016,9 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1011,7 +1031,9 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover" + } @distributed_trace_async async def begin_failover( @@ -1041,13 +1063,13 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._failover_initial( # type: ignore resource_group_name=resource_group_name, @@ -1066,7 +1088,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1078,6 +1100,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover" + } 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 ce10bf3cade2..3815694d765e 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 @@ -83,10 +83,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EncryptionProtectorListResult] + ) + cls: ClsType[_models.EncryptionProtectorListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -109,12 +109,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -122,13 +122,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -141,7 +141,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector" + } @distributed_trace_async async def get( @@ -177,10 +179,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EncryptionProtector] + ) + cls: ClsType[_models.EncryptionProtector] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -193,9 +195,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -212,7 +214,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}" + } async def _create_or_update_initial( self, @@ -233,11 +237,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.EncryptionProtector]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.EncryptionProtector]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -261,9 +265,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -282,7 +286,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}" + } @overload async def begin_create_or_update( @@ -405,16 +411,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EncryptionProtector] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, encryption_protector_name=encryption_protector_name, @@ -435,7 +441,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -447,9 +453,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}" + } async def _revalidate_initial( # pylint: disable=inconsistent-return-statements self, @@ -469,10 +477,10 @@ async def _revalidate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_revalidate_request( resource_group_name=resource_group_name, @@ -485,9 +493,9 @@ async def _revalidate_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -500,7 +508,9 @@ async def _revalidate_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _revalidate_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate"} # type: ignore + _revalidate_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate" + } @distributed_trace_async async def begin_revalidate( @@ -535,13 +545,13 @@ async def begin_revalidate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._revalidate_initial( # type: ignore resource_group_name=resource_group_name, @@ -560,7 +570,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -572,6 +582,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_revalidate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate"} # type: ignore + begin_revalidate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate" + } 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 728512c94834..6b118d1ce8b1 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 @@ -76,10 +76,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EndpointCertificateListResult] + ) + cls: ClsType[_models.EndpointCertificateListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -102,12 +102,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -115,13 +115,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -134,7 +134,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates" + } @distributed_trace_async async def get( @@ -166,10 +168,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EndpointCertificate] + ) + cls: ClsType[_models.EndpointCertificate] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -182,9 +184,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -201,4 +203,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates/{endpointType}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates/{endpointType}" + } 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 dcfbfbfeffe2..ed0238bb5dce 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 @@ -84,10 +84,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedDatabaseBlobAuditingPolicyListResult] + ) + cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,12 +111,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -124,13 +124,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -143,7 +143,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings" + } @distributed_trace_async async def get( @@ -177,11 +179,11 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] + ) + cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -195,9 +197,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -214,7 +216,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } @overload async def create_or_update( @@ -327,12 +331,12 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] + ) + 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 @@ -357,9 +361,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -376,8 +380,10 @@ async def create_or_update( deserialized = self._deserialize("ExtendedDatabaseBlobAuditingPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } 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 b748977dfe98..ffc1f5be5907 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 @@ -84,10 +84,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedServerBlobAuditingPolicyListResult] + ) + cls: ClsType[_models.ExtendedServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -123,13 +123,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings" + } @distributed_trace_async async def get( @@ -174,11 +176,11 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedServerBlobAuditingPolicy] + ) + cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -191,9 +193,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -210,7 +212,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } async def _create_or_update_initial( self, @@ -230,12 +234,12 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ExtendedServerBlobAuditingPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ExtendedServerBlobAuditingPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -259,9 +263,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -280,7 +284,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } @overload async def begin_create_or_update( @@ -403,17 +409,17 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedServerBlobAuditingPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, parameters=parameters, @@ -434,7 +440,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -446,6 +452,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } 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 e71eb83355e2..b22fd56062e7 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 @@ -96,10 +96,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] + ) + cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -112,9 +112,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -131,7 +131,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } async def _create_or_update_initial( self, @@ -152,11 +154,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FailoverGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -180,9 +182,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -204,7 +206,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } @overload async def begin_create_or_update( @@ -324,16 +328,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, failover_group_name=failover_group_name, @@ -354,7 +358,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -366,9 +370,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any @@ -384,10 +390,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -400,9 +406,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -415,7 +421,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } @distributed_trace_async async def begin_delete( @@ -445,13 +453,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -470,7 +478,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -482,9 +490,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } async def _update_initial( self, @@ -505,11 +515,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FailoverGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -533,9 +543,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -554,7 +564,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } @overload async def begin_update( @@ -674,16 +686,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, server_name=server_name, failover_group_name=failover_group_name, @@ -704,7 +716,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -716,9 +728,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } @distributed_trace def list_by_server( @@ -739,10 +753,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroupListResult] + ) + cls: ClsType[_models.FailoverGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -765,12 +779,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -778,13 +792,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -797,7 +811,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups" + } async def _failover_initial( self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any @@ -813,10 +829,10 @@ async def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FailoverGroup]] + ) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -829,9 +845,9 @@ async def _failover_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -850,7 +866,9 @@ async def _failover_initial( return deserialized - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover" + } @distributed_trace_async async def begin_failover( @@ -881,15 +899,15 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._failover_initial( # type: ignore + raw_result = await self._failover_initial( resource_group_name=resource_group_name, server_name=server_name, failover_group_name=failover_group_name, @@ -908,7 +926,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -920,9 +938,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover" + } async def _force_failover_allow_data_loss_initial( self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any @@ -938,10 +958,10 @@ async def _force_failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FailoverGroup]] + ) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) request = build_force_failover_allow_data_loss_request( resource_group_name=resource_group_name, @@ -954,9 +974,9 @@ async def _force_failover_allow_data_loss_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -975,7 +995,9 @@ async def _force_failover_allow_data_loss_initial( return deserialized - _force_failover_allow_data_loss_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss"} # type: ignore + _force_failover_allow_data_loss_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + } @distributed_trace_async async def begin_force_failover_allow_data_loss( @@ -1007,15 +1029,15 @@ async def begin_force_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._force_failover_allow_data_loss_initial( # type: ignore + 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, @@ -1034,7 +1056,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1046,6 +1068,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_force_failover_allow_data_loss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss"} # type: ignore + begin_force_failover_allow_data_loss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + } 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 644e0bba485f..9d901ef0200f 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 @@ -92,10 +92,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FirewallRule] + ) + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -108,9 +108,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -127,7 +127,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}" + } @overload async def create_or_update( @@ -231,11 +233,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FirewallRule] + ) + 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 @@ -259,9 +261,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -278,11 +280,13 @@ async def create_or_update( deserialized = self._deserialize("FirewallRule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -313,10 +317,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -329,9 +333,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -344,7 +348,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}" + } @distributed_trace def list_by_server( @@ -365,10 +371,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FirewallRuleListResult] + ) + cls: ClsType[_models.FirewallRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -391,12 +397,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -404,13 +410,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -423,7 +429,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules" + } @overload async def replace( @@ -513,11 +521,11 @@ async def replace( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FirewallRule]] + ) + 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 @@ -540,9 +548,9 @@ async def replace( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -561,4 +569,6 @@ async def replace( return deserialized - replace.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules"} # type: ignore + replace.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules" + } 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 07064e960627..8862cbec721f 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 @@ -174,9 +174,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GeoBackupPolicy] + api_version: Literal["2014-04-01"] = 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.GeoBackupPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -201,9 +201,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -220,11 +220,13 @@ async def create_or_update( deserialized = self._deserialize("GeoBackupPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}" + } @distributed_trace_async async def get( @@ -262,8 +264,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GeoBackupPolicy] + api_version: Literal["2014-04-01"] = 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, @@ -277,9 +279,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -296,7 +298,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}" + } @distributed_trace def list_by_database( @@ -319,8 +323,8 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GeoBackupPolicyListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.GeoBackupPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -344,12 +348,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -357,13 +361,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -376,4 +380,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies" + } 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 3957e33fbbf8..fd2dd4599320 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 @@ -95,10 +95,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroup] + ) + cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -111,9 +111,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -130,7 +130,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } async def _create_or_update_initial( self, @@ -151,11 +153,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstanceFailoverGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -179,9 +181,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -203,7 +205,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } @overload async def begin_create_or_update( @@ -323,16 +327,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, location_name=location_name, failover_group_name=failover_group_name, @@ -353,7 +357,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -365,9 +369,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any @@ -383,10 +389,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -399,9 +405,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -414,7 +420,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } @distributed_trace_async async def begin_delete( @@ -444,13 +452,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -469,7 +477,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -481,9 +489,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } @distributed_trace def list_by_location( @@ -505,10 +515,10 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroupListResult] + ) + cls: ClsType[_models.InstanceFailoverGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -531,12 +541,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -544,13 +554,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -563,7 +573,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups" + } async def _failover_initial( self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any @@ -579,10 +591,10 @@ async def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstanceFailoverGroup]] + ) + cls: ClsType[Optional[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -595,9 +607,9 @@ async def _failover_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -616,7 +628,9 @@ async def _failover_initial( return deserialized - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover" + } @distributed_trace_async async def begin_failover( @@ -647,15 +661,15 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._failover_initial( # type: ignore + raw_result = await self._failover_initial( resource_group_name=resource_group_name, location_name=location_name, failover_group_name=failover_group_name, @@ -674,7 +688,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -686,9 +700,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover" + } async def _force_failover_allow_data_loss_initial( self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any @@ -704,10 +720,10 @@ async def _force_failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstanceFailoverGroup]] + ) + cls: ClsType[Optional[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) request = build_force_failover_allow_data_loss_request( resource_group_name=resource_group_name, @@ -720,9 +736,9 @@ async def _force_failover_allow_data_loss_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -741,7 +757,9 @@ async def _force_failover_allow_data_loss_initial( return deserialized - _force_failover_allow_data_loss_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss"} # type: ignore + _force_failover_allow_data_loss_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + } @distributed_trace_async async def begin_force_failover_allow_data_loss( @@ -773,15 +791,15 @@ async def begin_force_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._force_failover_allow_data_loss_initial( # type: ignore + 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, @@ -800,7 +818,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -812,6 +830,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_force_failover_allow_data_loss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss"} # type: ignore + begin_force_failover_allow_data_loss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + } 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 1112a17badea..46f45b9936e4 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 @@ -91,10 +91,10 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePool] + ) + cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -106,9 +106,9 @@ async def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -125,7 +125,9 @@ async def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } async def _create_or_update_initial( self, @@ -145,11 +147,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstancePool]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.InstancePool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -172,9 +174,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -196,7 +198,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } @overload async def begin_create_or_update( @@ -307,16 +311,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePool] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, instance_pool_name=instance_pool_name, parameters=parameters, @@ -336,7 +340,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -348,9 +352,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, instance_pool_name: str, **kwargs: Any @@ -366,10 +372,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -381,9 +387,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -396,7 +402,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } @distributed_trace_async async def begin_delete( @@ -424,13 +432,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -448,7 +456,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -460,9 +468,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } async def _update_initial( self, @@ -482,11 +492,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstancePool]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.InstancePool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -509,9 +519,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -530,7 +540,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } @overload async def begin_update( @@ -641,16 +653,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePool] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, instance_pool_name=instance_pool_name, parameters=parameters, @@ -670,7 +682,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -682,9 +694,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.InstancePool"]: @@ -701,10 +715,10 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePoolListResult] + ) + cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -726,12 +740,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -739,13 +753,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -758,7 +772,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools" + } @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.InstancePool"]: @@ -772,10 +788,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.InstancePool"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePoolListResult] + ) + cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -796,12 +812,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -809,13 +825,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -828,4 +844,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/instancePools"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/instancePools"} 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 f9ccb487c123..907fb57d8fa2 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 @@ -81,10 +81,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IPv6FirewallRuleListResult] + ) + cls: ClsType[_models.IPv6FirewallRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -107,12 +107,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -120,13 +120,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -139,7 +139,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules" + } @distributed_trace_async async def get( @@ -170,10 +172,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IPv6FirewallRule] + ) + cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -186,9 +188,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -205,7 +207,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}" + } @overload async def create_or_update( @@ -311,11 +315,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IPv6FirewallRule] + ) + 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 @@ -339,9 +343,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -358,11 +362,13 @@ async def create_or_update( deserialized = self._deserialize("IPv6FirewallRule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -393,10 +399,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -409,9 +415,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -424,4 +430,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}" + } 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 62c6b029a47d..320cc090ea29 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 @@ -84,10 +84,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobAgentListResult] + ) + cls: ClsType[_models.JobAgentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -123,13 +123,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents" + } @distributed_trace_async async def get( @@ -173,10 +175,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobAgent] + ) + cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -189,9 +191,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -208,7 +210,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } async def _create_or_update_initial( self, @@ -229,11 +233,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobAgent]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.JobAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -257,9 +261,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -281,7 +285,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } @overload async def begin_create_or_update( @@ -401,16 +407,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobAgent] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, @@ -431,7 +437,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -443,9 +449,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any @@ -461,10 +469,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -477,9 +485,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -492,7 +500,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } @distributed_trace_async async def begin_delete( @@ -522,13 +532,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -547,7 +557,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -559,9 +569,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } async def _update_initial( self, @@ -582,11 +594,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobAgent]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.JobAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -610,9 +622,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -631,7 +643,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } @overload async def begin_update( @@ -750,16 +764,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobAgent] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, @@ -780,7 +794,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -792,6 +806,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } 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 607887f5f741..846bd8d77d1d 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 @@ -83,10 +83,10 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobCredentialListResult] + ) + cls: ClsType[_models.JobCredentialListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -123,13 +123,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_agent.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials"} # type: ignore + list_by_agent.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials" + } @distributed_trace_async async def get( @@ -175,10 +177,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobCredential] + ) + cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -192,9 +194,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -211,7 +213,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}" + } @overload async def create_or_update( @@ -324,11 +328,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobCredential] + ) + 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 @@ -353,9 +357,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -372,11 +376,13 @@ async def create_or_update( deserialized = self._deserialize("JobCredential", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -409,10 +415,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -426,9 +432,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -441,4 +447,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}" + } 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 81085aa37ed0..9c81a398b72c 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 @@ -118,10 +118,10 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -152,12 +152,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -165,13 +165,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -184,7 +184,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_agent.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/executions"} # type: ignore + list_by_agent.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/executions" + } @distributed_trace_async async def cancel( # pylint: disable=inconsistent-return-statements @@ -225,10 +227,10 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -243,9 +245,9 @@ async def cancel( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -258,7 +260,9 @@ async def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/cancel" + } async def _create_initial( self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any @@ -274,10 +278,10 @@ async def _create_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobExecution]] + ) + cls: ClsType[Optional[_models.JobExecution]] = kwargs.pop("cls", None) request = build_create_request( resource_group_name=resource_group_name, @@ -291,9 +295,9 @@ async def _create_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -312,7 +316,9 @@ async def _create_initial( return deserialized - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start" + } @distributed_trace_async async def begin_create( @@ -345,15 +351,15 @@ async def begin_create( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_initial( # type: ignore + raw_result = await self._create_initial( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, @@ -373,7 +379,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -385,9 +391,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start" + } @distributed_trace def list_by_job( @@ -443,10 +451,10 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -478,12 +486,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -491,13 +499,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -510,7 +518,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_job.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions"} # type: ignore + list_by_job.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions" + } @distributed_trace_async async def get( @@ -551,10 +561,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] + ) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -569,9 +579,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -588,7 +598,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}" + } async def _create_or_update_initial( self, @@ -610,10 +622,10 @@ async def _create_or_update_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobExecution]] + ) + cls: ClsType[Optional[_models.JobExecution]] = kwargs.pop("cls", None) request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -628,9 +640,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -652,7 +664,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}" + } @distributed_trace_async async def begin_create_or_update( @@ -693,15 +707,15 @@ async def begin_create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, @@ -722,7 +736,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -734,6 +748,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}" + } 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 b87e453b464f..61d854affd91 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 @@ -115,10 +115,10 @@ def list_by_job_execution( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -151,12 +151,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -164,13 +164,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -183,7 +183,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_job_execution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps"} # type: ignore + list_by_job_execution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps" + } @distributed_trace_async async def get( @@ -227,10 +229,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] + ) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -246,9 +248,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -265,4 +267,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}" + } 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 ae6c2311087d..38fc6fc14f90 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 @@ -95,10 +95,10 @@ def list_by_version( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStepListResult] + ) + cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -124,12 +124,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -137,13 +137,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -156,7 +156,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_version.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps"} # type: ignore + list_by_version.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps" + } @distributed_trace_async async def get_by_version( @@ -200,10 +202,10 @@ async def get_by_version( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStep] + ) + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) request = build_get_by_version_request( resource_group_name=resource_group_name, @@ -219,9 +221,9 @@ async def get_by_version( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -238,7 +240,9 @@ async def get_by_version( return deserialized - get_by_version.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps/{stepName}"} # type: ignore + get_by_version.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps/{stepName}" + } @distributed_trace def list_by_job( @@ -263,10 +267,10 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStepListResult] + ) + cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -291,12 +295,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -304,13 +308,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -323,7 +327,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_job.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps"} # type: ignore + list_by_job.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps" + } @distributed_trace_async async def get( @@ -364,10 +370,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStep] + ) + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -382,9 +388,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -401,7 +407,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}" + } @overload async def create_or_update( @@ -523,11 +531,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStep] + ) + 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 @@ -553,9 +561,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -572,11 +580,13 @@ async def create_or_update( deserialized = self._deserialize("JobStep", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -617,10 +627,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -635,9 +645,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -650,4 +660,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}" + } 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 70ac849b45ee..20a47305385d 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 @@ -119,10 +119,10 @@ def list_by_job_execution( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -155,12 +155,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -168,13 +168,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -187,7 +187,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_job_execution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets"} # type: ignore + list_by_job_execution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets" + } @distributed_trace def list_by_step( @@ -249,10 +251,10 @@ def list_by_step( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -286,12 +288,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -299,13 +301,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -318,7 +320,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_step.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets"} # type: ignore + list_by_step.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets" + } @distributed_trace_async async def get( @@ -365,10 +369,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] + ) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -385,9 +389,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -404,4 +408,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets/{targetId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets/{targetId}" + } 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 702e560aa623..58e9eefd8bdb 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 @@ -83,10 +83,10 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobTargetGroupListResult] + ) + cls: ClsType[_models.JobTargetGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -123,13 +123,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_agent.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups"} # type: ignore + list_by_agent.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups" + } @distributed_trace_async async def get( @@ -175,10 +177,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobTargetGroup] + ) + cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -192,9 +194,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -211,7 +213,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}" + } @overload async def create_or_update( @@ -324,11 +328,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobTargetGroup] + ) + 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 @@ -353,9 +357,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -372,11 +376,13 @@ async def create_or_update( deserialized = self._deserialize("JobTargetGroup", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -409,10 +415,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -426,9 +432,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -441,4 +447,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}" + } 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 c29ccdc7e634..bab8e8386659 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 @@ -80,10 +80,10 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobVersionListResult] + ) + cls: ClsType[_models.JobVersionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -108,12 +108,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -121,13 +121,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -140,7 +140,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_job.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions"} # type: ignore + list_by_job.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions" + } @distributed_trace_async async def get( @@ -181,10 +183,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobVersion] + ) + cls: ClsType[_models.JobVersion] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -199,9 +201,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -218,4 +220,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}" + } 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 1b4990bf9a63..71dcffe3d287 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 @@ -83,10 +83,10 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobListResult] + ) + cls: ClsType[_models.JobListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -123,13 +123,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_agent.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs"} # type: ignore + list_by_agent.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs" + } @distributed_trace_async async def get( @@ -175,10 +177,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Job] + ) + cls: ClsType[_models.Job] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -192,9 +194,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -211,7 +213,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}" + } @overload async def create_or_update( @@ -323,11 +327,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Job] + ) + 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 @@ -352,9 +356,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -371,11 +375,13 @@ async def create_or_update( deserialized = self._deserialize("Job", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -408,10 +414,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -425,9 +431,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -440,4 +446,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}" + } 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 05622096e201..fb668b19bef2 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 @@ -100,10 +100,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LedgerDigestUploads] + ) + cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -117,9 +117,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -136,7 +136,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + } async def _create_or_update_initial( self, @@ -158,11 +160,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LedgerDigestUploads]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LedgerDigestUploads]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -187,9 +189,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -208,7 +210,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + } @overload async def begin_create_or_update( @@ -339,16 +343,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LedgerDigestUploads] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -370,7 +374,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -382,9 +386,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + } @distributed_trace def list_by_database( @@ -407,10 +413,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LedgerDigestUploadsListResult] + ) + cls: ClsType[_models.LedgerDigestUploadsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -434,12 +440,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -447,13 +453,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -466,7 +472,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads" + } async def _disable_initial( self, @@ -487,10 +495,10 @@ async def _disable_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LedgerDigestUploads]] + ) + cls: ClsType[Optional[_models.LedgerDigestUploads]] = kwargs.pop("cls", None) request = build_disable_request( resource_group_name=resource_group_name, @@ -504,9 +512,9 @@ async def _disable_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -525,7 +533,9 @@ async def _disable_initial( return deserialized - _disable_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable"} # type: ignore + _disable_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable" + } @distributed_trace_async async def begin_disable( @@ -564,15 +574,15 @@ async def begin_disable( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LedgerDigestUploads] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._disable_initial( # type: ignore + raw_result = await self._disable_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -592,7 +602,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -604,6 +614,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_disable.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable"} # type: ignore + begin_disable.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable" + } 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 c9ab12c092e0..b55da768e4fa 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 @@ -94,11 +94,11 @@ async def _copy_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -123,9 +123,9 @@ async def _copy_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -144,7 +144,9 @@ async def _copy_initial( return deserialized - _copy_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy"} # type: ignore + _copy_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + } @overload async def begin_copy( @@ -273,16 +275,16 @@ async def begin_copy( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._copy_initial( # type: ignore + 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, @@ -304,7 +306,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -316,9 +318,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_copy.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy"} # type: ignore + begin_copy.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + } async def _update_initial( self, @@ -340,11 +344,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -369,9 +373,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -390,7 +394,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + } @overload async def begin_update( @@ -519,16 +525,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + 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, @@ -550,7 +556,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -562,9 +568,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + } @distributed_trace_async async def get( @@ -601,10 +609,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackup] + ) + cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -618,9 +626,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -637,7 +645,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -658,10 +668,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( location_name=location_name, @@ -675,9 +685,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -690,7 +700,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } @distributed_trace_async async def begin_delete( @@ -726,13 +738,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore location_name=location_name, @@ -752,7 +764,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -764,9 +776,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } @distributed_trace def list_by_database( @@ -801,10 +815,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -830,12 +844,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -843,13 +857,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -862,7 +876,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups" + } @distributed_trace def list_by_location( @@ -891,10 +907,10 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -918,12 +934,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -931,13 +947,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -950,7 +966,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups" + } @distributed_trace def list_by_server( @@ -982,10 +1000,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1010,12 +1028,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1023,13 +1041,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1042,7 +1060,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups" + } async def _copy_by_resource_group_initial( self, @@ -1065,11 +1085,11 @@ 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 = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1095,9 +1115,9 @@ async def _copy_by_resource_group_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1116,7 +1136,9 @@ async def _copy_by_resource_group_initial( return deserialized - _copy_by_resource_group_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy"} # type: ignore + _copy_by_resource_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + } @overload async def begin_copy_by_resource_group( @@ -1257,16 +1279,16 @@ 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 = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._copy_by_resource_group_initial( # type: ignore + 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, @@ -1289,7 +1311,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1301,9 +1323,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_copy_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy"} # type: ignore + begin_copy_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + } async def _update_by_resource_group_initial( self, @@ -1326,11 +1350,11 @@ 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 = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1356,9 +1380,9 @@ async def _update_by_resource_group_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1377,7 +1401,9 @@ async def _update_by_resource_group_initial( return deserialized - _update_by_resource_group_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update"} # type: ignore + _update_by_resource_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + } @overload async def begin_update_by_resource_group( @@ -1518,16 +1544,16 @@ 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 = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_by_resource_group_initial( # type: ignore + 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, @@ -1550,7 +1576,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1562,9 +1588,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update"} # type: ignore + begin_update_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + } @distributed_trace_async async def get_by_resource_group( @@ -1605,10 +1633,10 @@ async def get_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackup] + ) + cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_by_resource_group_request( resource_group_name=resource_group_name, @@ -1623,9 +1651,9 @@ async def get_by_resource_group( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1642,7 +1670,9 @@ async def get_by_resource_group( return deserialized - get_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + get_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } async def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-statements self, @@ -1664,10 +1694,10 @@ async def _delete_by_resource_group_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_by_resource_group_request( resource_group_name=resource_group_name, @@ -1682,9 +1712,9 @@ async def _delete_by_resource_group_initial( # pylint: disable=inconsistent-ret params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1697,7 +1727,9 @@ async def _delete_by_resource_group_initial( # pylint: disable=inconsistent-ret if cls: return cls(pipeline_response, None, {}) - _delete_by_resource_group_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + _delete_by_resource_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } @distributed_trace_async async def begin_delete_by_resource_group( @@ -1737,13 +1769,13 @@ async def begin_delete_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_by_resource_group_initial( # type: ignore resource_group_name=resource_group_name, @@ -1764,7 +1796,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1776,9 +1808,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + begin_delete_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } @distributed_trace def list_by_resource_group_database( @@ -1817,10 +1851,10 @@ def list_by_resource_group_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1847,12 +1881,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1860,13 +1894,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1879,7 +1913,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups"} # type: ignore + list_by_resource_group_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups" + } @distributed_trace def list_by_resource_group_location( @@ -1912,10 +1948,10 @@ def list_by_resource_group_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1940,12 +1976,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1953,13 +1989,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1972,7 +2008,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups"} # type: ignore + list_by_resource_group_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups" + } @distributed_trace def list_by_resource_group_server( @@ -2008,10 +2046,10 @@ def list_by_resource_group_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2037,12 +2075,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2050,13 +2088,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2069,4 +2107,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups"} # type: ignore + list_by_resource_group_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups" + } 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 acf5a47a751b..9ab8a60df092 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 @@ -100,10 +100,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackup] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -117,9 +117,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -136,7 +136,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any @@ -152,10 +154,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( location_name=location_name, @@ -169,9 +171,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -184,7 +186,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } @distributed_trace_async async def begin_delete( @@ -215,13 +219,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore location_name=location_name, @@ -241,7 +245,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -253,9 +257,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } @distributed_trace def list_by_database( @@ -291,10 +297,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -320,12 +326,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -333,13 +339,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -352,7 +358,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def list_by_instance( @@ -385,10 +393,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -413,12 +421,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -426,13 +434,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -445,7 +453,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def list_by_location( @@ -475,10 +485,10 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -502,12 +512,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -515,13 +525,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -534,7 +544,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace_async async def get_by_resource_group( @@ -575,10 +587,10 @@ async def get_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackup] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_by_resource_group_request( resource_group_name=resource_group_name, @@ -593,9 +605,9 @@ async def get_by_resource_group( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -612,7 +624,9 @@ async def get_by_resource_group( return deserialized - get_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + get_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } async def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-statements self, @@ -634,10 +648,10 @@ async def _delete_by_resource_group_initial( # pylint: disable=inconsistent-ret _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_by_resource_group_request( resource_group_name=resource_group_name, @@ -652,9 +666,9 @@ async def _delete_by_resource_group_initial( # pylint: disable=inconsistent-ret params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -667,7 +681,9 @@ async def _delete_by_resource_group_initial( # pylint: disable=inconsistent-ret if cls: return cls(pipeline_response, None, {}) - _delete_by_resource_group_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + _delete_by_resource_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } @distributed_trace_async async def begin_delete_by_resource_group( @@ -707,13 +723,13 @@ async def begin_delete_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_by_resource_group_initial( # type: ignore resource_group_name=resource_group_name, @@ -734,7 +750,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -746,9 +762,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + begin_delete_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } @distributed_trace def list_by_resource_group_database( @@ -788,10 +806,10 @@ def list_by_resource_group_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -818,12 +836,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -831,13 +849,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -850,7 +868,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_resource_group_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def list_by_resource_group_instance( @@ -887,10 +907,10 @@ def list_by_resource_group_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -916,12 +936,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -929,13 +949,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -948,7 +968,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_resource_group_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def list_by_resource_group_location( @@ -982,10 +1004,10 @@ def list_by_resource_group_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1010,12 +1032,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1023,13 +1045,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1042,4 +1064,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_resource_group_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups" + } 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 e24fe72e50dd..05c02c3a42b2 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 @@ -99,10 +99,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionPolicy] + ) + cls: ClsType[_models.LongTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -116,9 +116,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -135,7 +135,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } async def _create_or_update_initial( self, @@ -157,11 +159,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -186,9 +188,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -207,7 +209,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } @overload async def begin_create_or_update( @@ -336,16 +340,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -367,7 +371,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -379,9 +383,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_database( @@ -405,10 +411,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionPolicyListResult] + ) + cls: ClsType[_models.LongTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -432,12 +438,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -445,13 +451,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -464,4 +470,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies" + } 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 161eb056735e..3c96562c62a3 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 @@ -92,10 +92,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceWindowOptions] + ) + cls: ClsType[_models.MaintenanceWindowOptions] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -109,9 +109,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -128,4 +128,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindowOptions/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindowOptions/current" + } 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 2777bf547e4e..62beff697cd4 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 @@ -91,10 +91,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceWindows] + ) + cls: ClsType[_models.MaintenanceWindows] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -108,9 +108,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -127,7 +127,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current" + } @overload async def create_or_update( # pylint: disable=inconsistent-return-statements @@ -239,11 +241,11 @@ async 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -268,9 +270,9 @@ async def create_or_update( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -283,4 +285,6 @@ async def create_or_update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current" + } 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 4608ce6a868a..8821b224a806 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 @@ -100,10 +100,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] + ) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -117,9 +117,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -136,7 +136,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } async def _create_or_update_initial( self, @@ -158,11 +160,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -187,9 +189,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -208,7 +210,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @overload async def begin_create_or_update( @@ -340,16 +344,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, database_name=database_name, @@ -371,7 +375,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -383,9 +387,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } async def _update_initial( self, @@ -407,11 +413,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -436,9 +442,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -457,7 +463,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @overload async def begin_update( @@ -589,16 +597,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, database_name=database_name, @@ -620,7 +628,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -632,9 +640,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_database( @@ -659,10 +669,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] + ) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -686,12 +696,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -699,13 +709,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -718,4 +728,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies" + } 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 d648bcbca7a7..15f8c5470e20 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 @@ -84,10 +84,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseAdvancedThreatProtectionListResult] + ) + cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,12 +111,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -124,13 +124,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -143,7 +143,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings" + } @distributed_trace_async async def get( @@ -183,10 +185,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] + ) + cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -200,9 +202,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -219,7 +221,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } @overload async def create_or_update( @@ -338,11 +342,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] + ) + 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 @@ -367,9 +371,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -386,8 +390,10 @@ async def create_or_update( deserialized = self._deserialize("ManagedDatabaseAdvancedThreatProtection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } 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 5cae5cf300e0..1e8e79ef1a88 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 @@ -102,10 +102,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumnListResult] + ) + cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -134,12 +134,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -147,13 +147,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -166,7 +166,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/columns"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/columns" + } @distributed_trace def list_by_table( @@ -203,10 +205,10 @@ def list_by_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumnListResult] + ) + cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -233,12 +235,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -246,13 +248,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -265,7 +267,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns"} # type: ignore + list_by_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns" + } @distributed_trace_async async def get( @@ -309,10 +313,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumn] + ) + cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -328,9 +332,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -347,4 +351,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}" + } 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 07f29092e185..babe41bf2da3 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 @@ -89,10 +89,10 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseMoveOperationListResult] + ) + cls: ClsType[_models.ManagedDatabaseMoveOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -117,12 +117,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -130,13 +130,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -149,7 +149,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults" + } @distributed_trace_async async def get( @@ -180,10 +182,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseMoveOperationResult] + ) + cls: ClsType[_models.ManagedDatabaseMoveOperationResult] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -196,9 +198,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -215,4 +217,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults/{operationId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults/{operationId}" + } 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 49026445b8f2..790b81c3d530 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 @@ -88,10 +88,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceQuery] + ) + cls: ClsType[_models.ManagedInstanceQuery] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -105,9 +105,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -124,7 +124,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}" + } @distributed_trace def list_by_query( @@ -164,10 +166,10 @@ def list_by_query( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceQueryStatistics] + ) + cls: ClsType[_models.ManagedInstanceQueryStatistics] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -195,12 +197,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -208,13 +210,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -227,4 +229,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_query.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}/statistics"} # type: ignore + list_by_query.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}/statistics" + } 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 5e4fe20e92b0..2e09603b32a1 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 @@ -156,11 +156,11 @@ async 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -184,9 +184,9 @@ async def update( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -199,4 +199,6 @@ async def update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels" + } 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 0680134235de..1acf639ad82d 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 @@ -91,10 +91,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseRestoreDetailsResult] + ) + cls: ClsType[_models.ManagedDatabaseRestoreDetailsResult] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -108,9 +108,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -127,4 +127,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/restoreDetails/{restoreDetailsName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/restoreDetails/{restoreDetailsName}" + } 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 bed227024632..ba60239a2d71 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 @@ -86,10 +86,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSchemaListResult] + ) + cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -114,12 +114,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -127,13 +127,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -146,7 +146,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas" + } @distributed_trace_async async def get( @@ -179,10 +181,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSchema] + ) + cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -196,9 +198,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -215,4 +217,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}" + } 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 7367e3b3b3f9..933f5e68e316 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 @@ -98,10 +98,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] + ) + cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -115,9 +115,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -134,7 +134,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + } @overload async def create_or_update( @@ -250,11 +252,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] + ) + 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 @@ -279,9 +281,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -298,11 +300,13 @@ async def create_or_update( deserialized = self._deserialize("ManagedDatabaseSecurityAlertPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + } @distributed_trace def list_by_database( @@ -328,10 +332,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] + ) + cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -355,12 +359,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -368,13 +372,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -387,4 +391,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies" + } 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 e16dccde5bed..09ea19948835 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 @@ -96,10 +96,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityEventCollection] + ) + cls: ClsType[_models.SecurityEventCollection] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -127,12 +127,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -140,13 +140,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -159,4 +159,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityEvents"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityEvents" + } 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 5c167605498b..9f159dca7d08 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 @@ -112,10 +112,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabel] + ) + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -132,9 +132,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -151,7 +151,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @overload async def create_or_update( @@ -291,12 +293,12 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabel] + ) + 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 @@ -324,9 +326,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -343,11 +345,13 @@ async def create_or_update( deserialized = self._deserialize("SensitivityLabel", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -394,11 +398,11 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -415,9 +419,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -430,7 +434,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @distributed_trace_async async def disable_recommendation( # pylint: disable=inconsistent-return-statements @@ -477,11 +483,11 @@ async def disable_recommendation( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_disable_recommendation_request( resource_group_name=resource_group_name, @@ -498,9 +504,9 @@ async def disable_recommendation( # pylint: disable=inconsistent-return-stateme params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -513,7 +519,9 @@ async def disable_recommendation( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - disable_recommendation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable"} # type: ignore + disable_recommendation.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable" + } @distributed_trace_async async def enable_recommendation( # pylint: disable=inconsistent-return-statements @@ -561,11 +569,11 @@ async def enable_recommendation( # pylint: disable=inconsistent-return-statemen _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_enable_recommendation_request( resource_group_name=resource_group_name, @@ -582,9 +590,9 @@ async def enable_recommendation( # pylint: disable=inconsistent-return-statemen params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -597,7 +605,9 @@ async def enable_recommendation( # pylint: disable=inconsistent-return-statemen if cls: return cls(pipeline_response, None, {}) - enable_recommendation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable"} # type: ignore + enable_recommendation.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable" + } @distributed_trace def list_current_by_database( @@ -634,10 +644,10 @@ def list_current_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabelListResult] + ) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -664,12 +674,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -677,13 +687,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -696,7 +706,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_current_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels"} # type: ignore + list_current_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels" + } @overload async def update( # pylint: disable=inconsistent-return-statements @@ -799,11 +811,11 @@ async 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -827,9 +839,9 @@ async def update( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -842,7 +854,9 @@ async def update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels" + } @distributed_trace def list_recommended_by_database( @@ -880,10 +894,10 @@ def list_recommended_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabelListResult] + ) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -910,12 +924,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -923,13 +937,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -942,4 +956,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_recommended_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels"} # type: ignore + list_recommended_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels" + } 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 175c0825ca9d..d621e88869ff 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 @@ -89,10 +89,10 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseTableListResult] + ) + cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -118,12 +118,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -131,13 +131,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -150,7 +150,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_schema.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables"} # type: ignore + list_by_schema.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables" + } @distributed_trace_async async def get( @@ -191,10 +193,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseTable] + ) + cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -209,9 +211,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -228,4 +230,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}" + } 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 2f66b74d695d..6a77e5b47902 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 @@ -98,10 +98,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedTransparentDataEncryption] + ) + cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -115,9 +115,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -134,7 +134,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + } @overload async def create_or_update( @@ -250,11 +252,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedTransparentDataEncryption] + ) + 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 @@ -279,9 +281,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -298,11 +300,13 @@ async def create_or_update( deserialized = self._deserialize("ManagedTransparentDataEncryption", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + } @distributed_trace def list_by_database( @@ -328,10 +332,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedTransparentDataEncryptionListResult] + ) + cls: ClsType[_models.ManagedTransparentDataEncryptionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -355,12 +359,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -368,13 +372,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -387,4 +391,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption" + } 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 d4fbbd833821..810305078cdb 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 @@ -105,10 +105,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -124,9 +124,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -143,7 +143,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } @overload async def create_or_update( @@ -286,11 +288,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] + ) + 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 @@ -317,9 +319,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -336,7 +338,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -384,10 +388,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -403,9 +407,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -418,4 +422,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } 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 2c09b21a88e1..fba39de85dc2 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 @@ -84,10 +84,10 @@ async def _initiate_scan_initial( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_initiate_scan_request( resource_group_name=resource_group_name, @@ -102,9 +102,9 @@ async def _initiate_scan_initial( # pylint: disable=inconsistent-return-stateme params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -117,7 +117,9 @@ async def _initiate_scan_initial( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - _initiate_scan_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan"} # type: ignore + _initiate_scan_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + } @distributed_trace_async async def begin_initiate_scan( @@ -158,13 +160,13 @@ async def begin_initiate_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._initiate_scan_initial( # type: ignore resource_group_name=resource_group_name, @@ -185,7 +187,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -197,9 +199,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_initiate_scan.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan"} # type: ignore + begin_initiate_scan.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + } @distributed_trace_async async def export( @@ -241,10 +245,10 @@ async def export( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) request = build_export_request( resource_group_name=resource_group_name, @@ -259,9 +263,9 @@ async def export( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -278,11 +282,13 @@ async def export( deserialized = self._deserialize("DatabaseVulnerabilityAssessmentScansExport", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - export.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export"} # type: ignore + export.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export" + } @distributed_trace def list_by_database( @@ -315,10 +321,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] + ) + cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -343,12 +349,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -356,13 +362,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -375,7 +381,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + } @distributed_trace_async async def get( @@ -417,10 +425,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VulnerabilityAssessmentScanRecord] + ) + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -435,9 +443,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -454,4 +462,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + } 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 2340a864e96b..662af85265ac 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 @@ -100,10 +100,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessment] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -117,9 +117,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -136,7 +136,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload async def create_or_update( @@ -254,11 +256,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessment] + ) + 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 @@ -283,9 +285,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -302,11 +304,13 @@ async def create_or_update( deserialized = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -346,10 +350,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -363,9 +367,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -378,7 +382,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def list_by_database( @@ -404,10 +410,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -431,12 +437,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -444,13 +450,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -463,4 +469,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments" + } 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 45c53f7d7165..b5a33191c909 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 @@ -89,10 +89,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseListResult] + ) + cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -115,12 +115,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -128,13 +128,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -147,7 +147,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases" + } @distributed_trace_async async def get( @@ -178,10 +180,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabase] + ) + cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -194,9 +196,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -213,7 +215,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } async def _create_or_update_initial( self, @@ -234,11 +238,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedDatabase]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedDatabase]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -262,9 +266,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -286,7 +290,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } @overload async def begin_create_or_update( @@ -406,16 +412,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabase] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, database_name=database_name, @@ -436,7 +442,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -448,9 +454,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any @@ -466,10 +474,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -482,9 +490,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -497,7 +505,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } @distributed_trace_async async def begin_delete( @@ -527,13 +537,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -552,7 +562,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -564,9 +574,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } async def _update_initial( self, @@ -587,11 +599,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedDatabase]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedDatabase]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -615,9 +627,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -636,7 +648,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } @overload async def begin_update( @@ -756,16 +770,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabase] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, database_name=database_name, @@ -786,7 +800,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -798,9 +812,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } async def _cancel_move_initial( # pylint: disable=inconsistent-return-statements self, @@ -821,11 +837,11 @@ async def _cancel_move_initial( # pylint: disable=inconsistent-return-statement _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -849,9 +865,9 @@ async def _cancel_move_initial( # pylint: disable=inconsistent-return-statement params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -864,7 +880,9 @@ async def _cancel_move_initial( # pylint: disable=inconsistent-return-statement if cls: return cls(pipeline_response, None, {}) - _cancel_move_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove"} # type: ignore + _cancel_move_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove" + } @overload async def begin_cancel_move( @@ -981,14 +999,14 @@ async def begin_cancel_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._cancel_move_initial( # type: ignore resource_group_name=resource_group_name, @@ -1009,7 +1027,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1021,9 +1039,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_cancel_move.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove"} # type: ignore + begin_cancel_move.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove" + } async def _complete_move_initial( # pylint: disable=inconsistent-return-statements self, @@ -1044,11 +1064,11 @@ async def _complete_move_initial( # pylint: disable=inconsistent-return-stateme _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -1072,9 +1092,9 @@ async def _complete_move_initial( # pylint: disable=inconsistent-return-stateme params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1087,7 +1107,9 @@ async def _complete_move_initial( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - _complete_move_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove"} # type: ignore + _complete_move_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove" + } @overload async def begin_complete_move( @@ -1204,14 +1226,14 @@ async def begin_complete_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._complete_move_initial( # type: ignore resource_group_name=resource_group_name, @@ -1232,7 +1254,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1244,9 +1266,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_complete_move.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove"} # type: ignore + begin_complete_move.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove" + } async def _complete_restore_initial( # pylint: disable=inconsistent-return-statements self, @@ -1267,11 +1291,11 @@ async def _complete_restore_initial( # pylint: disable=inconsistent-return-stat _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -1295,9 +1319,9 @@ async def _complete_restore_initial( # pylint: disable=inconsistent-return-stat params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1310,7 +1334,9 @@ async def _complete_restore_initial( # pylint: disable=inconsistent-return-stat if cls: return cls(pipeline_response, None, {}) - _complete_restore_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore"} # type: ignore + _complete_restore_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore" + } @overload async def begin_complete_restore( @@ -1429,14 +1455,14 @@ async def begin_complete_restore( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._complete_restore_initial( # type: ignore resource_group_name=resource_group_name, @@ -1457,7 +1483,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1469,9 +1495,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_complete_restore.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore"} # type: ignore + begin_complete_restore.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore" + } async def _start_move_initial( # pylint: disable=inconsistent-return-statements self, @@ -1492,11 +1520,11 @@ async def _start_move_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -1520,9 +1548,9 @@ async def _start_move_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1535,7 +1563,9 @@ async def _start_move_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _start_move_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove"} # type: ignore + _start_move_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove" + } @overload async def begin_start_move( @@ -1652,14 +1682,14 @@ async def begin_start_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._start_move_initial( # type: ignore resource_group_name=resource_group_name, @@ -1680,7 +1710,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1692,9 +1722,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_start_move.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove"} # type: ignore + begin_start_move.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove" + } @distributed_trace def list_inaccessible_by_instance( @@ -1715,10 +1747,10 @@ def list_inaccessible_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseListResult] + ) + cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1741,12 +1773,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1754,13 +1786,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1773,4 +1805,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_inaccessible_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/inaccessibleManagedDatabases"} # type: ignore + list_inaccessible_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/inaccessibleManagedDatabases" + } 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 90062dde5562..1f1f7ed8645c 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 @@ -85,10 +85,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdministratorListResult] + ) + cls: ClsType[_models.ManagedInstanceAdministratorListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,12 +111,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -124,13 +124,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -143,7 +143,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators" + } @distributed_trace_async async def get( @@ -178,10 +180,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdministrator] + ) + cls: ClsType[_models.ManagedInstanceAdministrator] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -194,9 +196,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -213,7 +215,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } async def _create_or_update_initial( self, @@ -234,11 +238,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceAdministrator]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceAdministrator]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -262,9 +266,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -286,7 +290,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } @overload async def begin_create_or_update( @@ -406,16 +412,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdministrator] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, administrator_name=administrator_name, @@ -436,7 +442,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -448,9 +454,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -470,10 +478,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -486,9 +494,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -501,7 +509,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } @distributed_trace_async async def begin_delete( @@ -535,13 +545,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -560,7 +570,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -572,6 +582,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } 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 0a921f14761b..784e962e0311 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 @@ -84,10 +84,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdvancedThreatProtectionListResult] + ) + cls: ClsType[_models.ManagedInstanceAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -123,13 +123,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings" + } @distributed_trace_async async def get( @@ -179,10 +181,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdvancedThreatProtection] + ) + cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -195,9 +197,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -214,7 +216,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } async def _create_or_update_initial( self, @@ -235,11 +239,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceAdvancedThreatProtection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceAdvancedThreatProtection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -263,9 +267,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -284,7 +288,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } @overload async def begin_create_or_update( @@ -413,16 +419,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdvancedThreatProtection] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + 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, @@ -443,7 +449,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -455,6 +461,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } 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 01506a609fa5..f212cdf88b7b 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 @@ -98,10 +98,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] + ) + cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -114,9 +114,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -133,7 +133,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } async def _create_or_update_initial( self, @@ -154,11 +156,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceAzureADOnlyAuthentication]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceAzureADOnlyAuthentication]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -182,9 +184,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -206,7 +208,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } @overload async def begin_create_or_update( @@ -337,16 +341,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, authentication_name=authentication_name, @@ -367,7 +371,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -379,9 +383,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -401,10 +407,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -417,9 +423,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -432,7 +438,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } @distributed_trace_async async def begin_delete( @@ -467,13 +475,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -492,7 +500,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -504,9 +512,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } @distributed_trace def list_by_instance( @@ -529,10 +539,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] + ) + cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -555,12 +565,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -568,13 +578,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -587,4 +597,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications" + } 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 3ebb1ffa3098..7286d8b75e5d 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 @@ -82,10 +82,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceDtcListResult] + ) + cls: ClsType[_models.ManagedInstanceDtcListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -108,12 +108,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -121,13 +121,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -140,7 +140,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc" + } @distributed_trace_async async def get( @@ -171,10 +173,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceDtc] + ) + cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -187,9 +189,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -206,7 +208,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + } async def _create_or_update_initial( self, @@ -227,11 +231,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceDtc] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -255,9 +259,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -274,7 +278,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + } @overload async def begin_create_or_update( @@ -394,16 +400,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceDtc] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, dtc_name=dtc_name, @@ -424,7 +430,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -436,6 +442,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + } 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 445627b9bfd8..b7080b2d1d83 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 @@ -82,10 +82,10 @@ async def _revalidate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_revalidate_request( resource_group_name=resource_group_name, @@ -98,9 +98,9 @@ async def _revalidate_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -113,7 +113,9 @@ async def _revalidate_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _revalidate_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate"} # type: ignore + _revalidate_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate" + } @distributed_trace_async async def begin_revalidate( @@ -148,13 +150,13 @@ async def begin_revalidate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._revalidate_initial( # type: ignore resource_group_name=resource_group_name, @@ -173,7 +175,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -185,9 +187,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_revalidate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate"} # type: ignore + begin_revalidate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate" + } @distributed_trace def list_by_instance( @@ -210,10 +214,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceEncryptionProtectorListResult] + ) + cls: ClsType[_models.ManagedInstanceEncryptionProtectorListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -236,12 +240,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -249,13 +253,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -268,7 +272,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector" + } @distributed_trace_async async def get( @@ -304,10 +310,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceEncryptionProtector] + ) + cls: ClsType[_models.ManagedInstanceEncryptionProtector] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -320,9 +326,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -339,7 +345,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}" + } async def _create_or_update_initial( self, @@ -360,11 +368,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceEncryptionProtector]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceEncryptionProtector]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -388,9 +396,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -409,7 +417,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}" + } @overload async def begin_create_or_update( @@ -535,16 +545,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceEncryptionProtector] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + 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, @@ -565,7 +575,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -577,6 +587,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}" + } 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 7fe5218c032f..b54f878f5008 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 @@ -86,10 +86,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceKeyListResult] + ) + cls: ClsType[_models.ManagedInstanceKeyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -113,12 +113,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -126,13 +126,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -145,7 +145,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys" + } @distributed_trace_async async def get( @@ -176,10 +178,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceKey] + ) + cls: ClsType[_models.ManagedInstanceKey] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -192,9 +194,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -211,7 +213,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } async def _create_or_update_initial( self, @@ -232,11 +236,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceKey]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceKey]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -260,9 +264,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -284,7 +288,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } @overload async def begin_create_or_update( @@ -407,16 +413,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceKey] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, key_name=key_name, @@ -437,7 +443,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -449,9 +455,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any @@ -467,10 +475,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -483,9 +491,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -498,7 +506,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } @distributed_trace_async async def begin_delete( @@ -528,13 +538,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -553,7 +563,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -565,6 +575,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } 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 28df507bb176..104e75c29024 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 @@ -99,10 +99,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -116,9 +116,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -135,7 +135,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } async def _create_or_update_initial( self, @@ -157,11 +159,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceLongTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceLongTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -186,9 +188,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -207,7 +209,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } @overload async def begin_create_or_update( @@ -339,16 +343,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, database_name=database_name, @@ -370,7 +374,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -382,9 +386,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_database( @@ -409,10 +415,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -436,12 +442,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -449,13 +455,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -468,4 +474,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies" + } 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 795617e71240..02cd1d8e1549 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 @@ -82,10 +82,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceOperationListResult] + ) + cls: ClsType[_models.ManagedInstanceOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -108,12 +108,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -121,13 +121,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -140,7 +140,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations" + } @distributed_trace_async async def get( @@ -171,10 +173,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceOperation] + ) + cls: ClsType[_models.ManagedInstanceOperation] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -187,9 +189,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -206,7 +208,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}" + } @distributed_trace_async async def cancel( # pylint: disable=inconsistent-return-statements @@ -237,10 +241,10 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -253,9 +257,9 @@ async def cancel( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -268,4 +272,6 @@ async def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}/cancel" + } 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 01466dfddcd1..03beb7cd5617 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 @@ -93,10 +93,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateEndpointConnection] + ) + cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -109,9 +109,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -128,7 +128,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } async def _create_or_update_initial( self, @@ -149,11 +151,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstancePrivateEndpointConnection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstancePrivateEndpointConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -177,9 +179,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -198,7 +200,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @overload async def begin_create_or_update( @@ -320,16 +324,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateEndpointConnection] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + 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, @@ -350,7 +354,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -362,9 +366,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -380,10 +386,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -396,9 +402,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -411,7 +417,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace_async async def begin_delete( @@ -441,13 +449,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -466,7 +474,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -478,9 +486,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace def list_by_managed_instance( @@ -503,10 +513,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] + ) + cls: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -529,12 +539,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -542,13 +552,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -561,4 +571,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections" + } 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 53db792d6004..c9d2405b86d7 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 @@ -81,10 +81,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateLinkListResult] + ) + cls: ClsType[_models.ManagedInstancePrivateLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -107,12 +107,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -120,13 +120,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -139,7 +139,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources" + } @distributed_trace_async async def get( @@ -170,10 +172,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateLink] + ) + cls: ClsType[_models.ManagedInstancePrivateLink] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -186,9 +188,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -205,4 +207,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources/{groupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources/{groupName}" + } 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 268e6404e0aa..cce3b8fe088c 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,11 +75,11 @@ async def _create_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -102,9 +102,9 @@ async def _create_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -117,7 +117,9 @@ async def _create_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates" + } @overload async def begin_create( @@ -225,14 +227,14 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._create_initial( # type: ignore resource_group_name=resource_group_name, @@ -252,7 +254,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -264,6 +266,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates" + } 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 a3cae18d91fa..b81f57346b44 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 @@ -97,10 +97,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceVulnerabilityAssessment] + ) + cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -113,9 +113,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -132,7 +132,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload async def create_or_update( @@ -247,11 +249,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceVulnerabilityAssessment] + ) + 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 @@ -275,9 +277,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -294,11 +296,13 @@ async def create_or_update( deserialized = self._deserialize("ManagedInstanceVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -335,10 +339,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -351,9 +355,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -366,7 +370,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def list_by_instance( @@ -390,10 +396,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -416,12 +422,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -429,13 +435,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -448,4 +454,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments" + } 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 c4af3e6a365f..2b9134ef891b 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 @@ -90,10 +90,10 @@ def list_by_instance_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceListResult] + ) + cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -117,12 +117,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -130,13 +130,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -149,7 +149,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances"} # type: ignore + list_by_instance_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances" + } @distributed_trace def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_models.ManagedInstance"]: @@ -165,10 +167,10 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceListResult] + ) + cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -190,12 +192,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -203,13 +205,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -222,7 +224,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances"} @distributed_trace def list_by_resource_group( @@ -243,10 +245,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceListResult] + ) + cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -269,12 +271,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -282,13 +284,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -301,7 +303,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances" + } @distributed_trace_async async def get( @@ -332,10 +336,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstance] + ) + cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -348,9 +352,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -367,7 +371,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } async def _create_or_update_initial( self, @@ -387,11 +393,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstance]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -414,9 +420,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -438,7 +444,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } @overload async def begin_create_or_update( @@ -549,16 +557,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstance] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, parameters=parameters, @@ -578,7 +586,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -590,9 +598,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, **kwargs: Any @@ -608,10 +618,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -623,9 +633,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -638,7 +648,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } @distributed_trace_async async def begin_delete( @@ -666,13 +678,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -690,7 +702,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -702,9 +714,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } async def _update_initial( self, @@ -724,11 +738,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstance]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -751,9 +765,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -772,7 +786,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } @overload async def begin_update( @@ -883,16 +899,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstance] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, parameters=parameters, @@ -912,7 +928,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -924,9 +940,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } @distributed_trace def list_by_managed_instance( @@ -976,10 +994,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TopQueriesListResult] + ) + cls: ClsType[_models.TopQueriesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1009,12 +1027,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1022,13 +1040,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1041,7 +1059,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/topqueries"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/topqueries" + } async def _failover_initial( # pylint: disable=inconsistent-return-statements self, @@ -1061,10 +1081,10 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -1077,9 +1097,9 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1092,7 +1112,9 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover" + } @distributed_trace_async async def begin_failover( @@ -1127,13 +1149,13 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._failover_initial( # type: ignore resource_group_name=resource_group_name, @@ -1152,7 +1174,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1164,6 +1186,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover" + } 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 68fbfae1a0fc..1e84dd1eb5f5 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 @@ -100,10 +100,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] + ) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -117,9 +117,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -136,7 +136,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } async def _create_or_update_initial( self, @@ -158,11 +160,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -187,9 +189,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -208,7 +210,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } @overload async def begin_create_or_update( @@ -340,16 +344,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + 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, @@ -371,7 +375,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -383,9 +387,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } async def _update_initial( self, @@ -407,11 +413,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -436,9 +442,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -457,7 +463,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } @overload async def begin_update( @@ -589,16 +597,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + 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, @@ -620,7 +628,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -632,9 +640,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_restorable_dropped_database( @@ -659,10 +669,10 @@ def list_by_restorable_dropped_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] + ) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -686,12 +696,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -699,13 +709,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -718,4 +728,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_restorable_dropped_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies"} # type: ignore + list_by_restorable_dropped_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies" + } 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 1973278501f4..ad68bc6a244a 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 @@ -85,10 +85,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerDnsAliasListResult] + ) + cls: ClsType[_models.ManagedServerDnsAliasListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,12 +111,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -124,13 +124,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -143,7 +143,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases" + } @distributed_trace_async async def get( @@ -174,10 +176,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerDnsAlias] + ) + cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -190,9 +192,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -209,7 +211,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } async def _create_or_update_initial( self, @@ -230,11 +234,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedServerDnsAlias]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -258,9 +262,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -282,7 +286,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } @overload async def begin_create_or_update( @@ -401,16 +407,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerDnsAlias] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + 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, @@ -431,7 +437,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -443,9 +449,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any @@ -461,10 +469,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -477,9 +485,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -492,7 +500,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } @distributed_trace_async async def begin_delete( @@ -522,13 +532,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -547,7 +557,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -559,9 +569,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } async def _acquire_initial( self, @@ -582,11 +594,11 @@ async def _acquire_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedServerDnsAlias]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -610,9 +622,9 @@ async def _acquire_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -631,7 +643,9 @@ async def _acquire_initial( return deserialized - _acquire_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire"} # type: ignore + _acquire_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire" + } @overload async def begin_acquire( @@ -750,16 +764,16 @@ async def begin_acquire( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerDnsAlias] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._acquire_initial( # type: ignore + raw_result = await self._acquire_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, dns_alias_name=dns_alias_name, @@ -780,7 +794,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -792,6 +806,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_acquire.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire"} # type: ignore + begin_acquire.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire" + } 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 178f89373a98..50f88fe86ee0 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 @@ -96,10 +96,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerSecurityAlertPolicy] + ) + cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -112,9 +112,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -131,7 +131,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" + } async def _create_or_update_initial( self, @@ -152,11 +154,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedServerSecurityAlertPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedServerSecurityAlertPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -180,9 +182,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -201,7 +203,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" + } @overload async def begin_create_or_update( @@ -324,16 +328,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerSecurityAlertPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + 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, @@ -354,7 +358,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -366,9 +370,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" + } @distributed_trace def list_by_instance( @@ -391,10 +397,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] + ) + cls: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -417,12 +423,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -430,13 +436,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -449,4 +455,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies" + } 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 c6170128bbc3..fef56678a74d 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 @@ -68,10 +68,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -91,12 +91,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -104,13 +104,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -123,4 +123,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.Sql/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Sql/operations"} 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 725efcd579b8..30e5a93163a3 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 @@ -93,10 +93,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundFirewallRule] + ) + cls: ClsType[_models.OutboundFirewallRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -109,9 +109,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -128,7 +128,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } async def _create_or_update_initial( self, @@ -149,11 +151,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OutboundFirewallRule]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.OutboundFirewallRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -177,9 +179,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -201,7 +203,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } @overload async def begin_create_or_update( @@ -320,16 +324,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundFirewallRule] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, outbound_rule_fqdn=outbound_rule_fqdn, @@ -350,7 +354,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -362,9 +366,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any @@ -380,10 +386,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -396,9 +402,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -411,7 +417,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } @distributed_trace_async async def begin_delete( @@ -441,13 +449,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -466,7 +474,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -478,9 +486,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } @distributed_trace def list_by_server( @@ -502,10 +512,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundFirewallRuleListResult] + ) + cls: ClsType[_models.OutboundFirewallRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -528,12 +538,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -541,13 +551,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -560,4 +570,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules" + } 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 2002c62ce3ae..01f56af1af32 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 @@ -93,10 +93,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] + ) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -109,9 +109,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -128,7 +128,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } async def _create_or_update_initial( self, @@ -149,11 +151,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PrivateEndpointConnection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -177,9 +179,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -198,7 +200,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @overload async def begin_create_or_update( @@ -317,16 +321,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + 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, @@ -347,7 +351,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -359,9 +363,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -377,10 +383,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -393,9 +399,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -408,7 +414,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace_async async def begin_delete( @@ -438,13 +446,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -463,7 +471,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -475,9 +483,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace def list_by_server( @@ -500,10 +510,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] + ) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -526,12 +536,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -539,13 +549,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -558,4 +568,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections" + } 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 8d10581d149c..6b30d260e713 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 @@ -76,10 +76,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] + ) + cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -102,12 +102,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -115,13 +115,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -134,7 +134,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources" + } @distributed_trace_async async def get( @@ -165,10 +167,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResource] + ) + cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -181,9 +183,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -200,4 +202,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources/{groupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources/{groupName}" + } 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 387bcb9e6000..bb79255a7e0c 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 @@ -156,11 +156,11 @@ async 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -184,9 +184,9 @@ async def update( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -199,4 +199,6 @@ async def update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels" + } 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 68ad5e9cc943..7934fcefa532 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 @@ -86,8 +86,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoverableDatabase] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.RecoverableDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -100,9 +100,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -119,7 +119,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases/{databaseName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases/{databaseName}" + } @distributed_trace def list_by_server( @@ -140,8 +142,8 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoverableDatabaseListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.RecoverableDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -164,12 +166,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -177,13 +179,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -196,4 +198,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases" + } 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 cd6e0a835b63..8a841c14123c 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 @@ -78,10 +78,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoverableManagedDatabaseListResult] + ) + cls: ClsType[_models.RecoverableManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -104,12 +104,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -117,13 +117,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -136,7 +136,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases" + } @distributed_trace_async async def get( @@ -167,10 +169,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoverableManagedDatabase] + ) + cls: ClsType[_models.RecoverableManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -183,9 +185,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -202,4 +204,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases/{recoverableDatabaseName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases/{recoverableDatabaseName}" + } 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 9a6e75c7eab3..f0f4467cd2ea 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 @@ -87,10 +87,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLinkListResult] + ) + cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -114,12 +114,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -127,13 +127,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -146,7 +146,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks" + } @distributed_trace_async async def get( @@ -179,10 +181,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLink] + ) + cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -196,9 +198,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -215,7 +217,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any @@ -231,10 +235,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -248,9 +252,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -263,7 +267,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + } @distributed_trace_async async def begin_delete( @@ -295,13 +301,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -321,7 +327,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -333,9 +339,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + } async def _failover_initial( self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any @@ -351,10 +359,10 @@ async def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ReplicationLink]] + ) + cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -368,9 +376,9 @@ async def _failover_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -389,7 +397,9 @@ async def _failover_initial( return deserialized - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover" + } @distributed_trace_async async def begin_failover( @@ -422,15 +432,15 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLink] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._failover_initial( # type: ignore + raw_result = await self._failover_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -450,7 +460,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -462,9 +472,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover" + } async def _failover_allow_data_loss_initial( self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any @@ -480,10 +492,10 @@ async def _failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ReplicationLink]] + ) + cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) request = build_failover_allow_data_loss_request( resource_group_name=resource_group_name, @@ -497,9 +509,9 @@ async def _failover_allow_data_loss_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -518,7 +530,9 @@ async def _failover_allow_data_loss_initial( return deserialized - _failover_allow_data_loss_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss"} # type: ignore + _failover_allow_data_loss_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss" + } @distributed_trace_async async def begin_failover_allow_data_loss( @@ -551,15 +565,15 @@ async def begin_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLink] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._failover_allow_data_loss_initial( # type: ignore + raw_result = await self._failover_allow_data_loss_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -579,7 +593,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -591,9 +605,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover_allow_data_loss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss"} # type: ignore + begin_failover_allow_data_loss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss" + } @distributed_trace def list_by_server( @@ -614,10 +630,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLinkListResult] + ) + cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -640,12 +656,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -653,13 +669,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -672,4 +688,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/replicationLinks"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/replicationLinks" + } 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 0fa5588d56cb..b241be3a50aa 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 @@ -78,10 +78,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDroppedDatabaseListResult] + ) + cls: ClsType[_models.RestorableDroppedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -104,12 +104,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -117,13 +117,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -136,7 +136,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases" + } @distributed_trace_async async def get( @@ -167,10 +169,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDroppedDatabase] + ) + cls: ClsType[_models.RestorableDroppedDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -183,9 +185,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -202,4 +204,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}" + } 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 8c2efc5e0f58..1b1338131e19 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 @@ -81,10 +81,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDroppedManagedDatabaseListResult] + ) + cls: ClsType[_models.RestorableDroppedManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -107,12 +107,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -120,13 +120,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -139,7 +139,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases" + } @distributed_trace_async async def get( @@ -170,10 +172,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDroppedManagedDatabase] + ) + cls: ClsType[_models.RestorableDroppedManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -186,9 +188,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -205,4 +207,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}" + } 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 d35a5102233e..1f50ed913d10 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 @@ -85,10 +85,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointListResult] + ) + cls: ClsType[_models.RestorePointListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -112,12 +112,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -125,13 +125,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -144,7 +144,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints" + } async def _create_initial( self, @@ -165,11 +167,11 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RestorePoint]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.RestorePoint]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -193,9 +195,9 @@ async def _create_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -217,7 +219,9 @@ async def _create_initial( return deserialized - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints" + } @overload async def begin_create( @@ -337,16 +341,16 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_initial( # type: ignore + raw_result = await self._create_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -367,7 +371,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -379,9 +383,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints" + } @distributed_trace_async async def get( @@ -414,10 +420,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] + ) + cls: ClsType[_models.RestorePoint] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -431,9 +437,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -450,7 +456,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -483,10 +491,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -500,9 +508,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -515,4 +523,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}" + } 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 29e54151ebc2..3dcaaa3d1cf9 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 @@ -101,10 +101,10 @@ def list_current_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabelListResult] + ) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -131,12 +131,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -144,13 +144,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -163,7 +163,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_current_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels"} # type: ignore + list_current_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels" + } @overload async def update( # pylint: disable=inconsistent-return-statements @@ -266,11 +268,11 @@ async 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -294,9 +296,9 @@ async def update( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -309,7 +311,9 @@ async def update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels" + } @distributed_trace def list_recommended_by_database( @@ -347,10 +351,10 @@ def list_recommended_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabelListResult] + ) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -377,12 +381,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -390,13 +394,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -409,7 +413,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_recommended_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels"} # type: ignore + list_recommended_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels" + } @distributed_trace_async async def enable_recommendation( # pylint: disable=inconsistent-return-statements @@ -457,11 +463,11 @@ async def enable_recommendation( # pylint: disable=inconsistent-return-statemen _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_enable_recommendation_request( resource_group_name=resource_group_name, @@ -478,9 +484,9 @@ async def enable_recommendation( # pylint: disable=inconsistent-return-statemen params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -493,7 +499,9 @@ async def enable_recommendation( # pylint: disable=inconsistent-return-statemen if cls: return cls(pipeline_response, None, {}) - enable_recommendation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable"} # type: ignore + enable_recommendation.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable" + } @distributed_trace_async async def disable_recommendation( # pylint: disable=inconsistent-return-statements @@ -540,11 +548,11 @@ async def disable_recommendation( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_disable_recommendation_request( resource_group_name=resource_group_name, @@ -561,9 +569,9 @@ async def disable_recommendation( # pylint: disable=inconsistent-return-stateme params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -576,7 +584,9 @@ async def disable_recommendation( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - disable_recommendation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable"} # type: ignore + disable_recommendation.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable" + } @distributed_trace_async async def get( @@ -624,10 +634,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabel] + ) + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -644,9 +654,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -663,7 +673,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @overload async def create_or_update( @@ -803,12 +815,12 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabel] + ) + 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 @@ -836,9 +848,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -855,11 +867,13 @@ async def create_or_update( deserialized = self._deserialize("SensitivityLabel", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -906,11 +920,11 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -927,9 +941,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -942,4 +956,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } 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 5e37ae9052a4..a5ae92a999ce 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 @@ -84,10 +84,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LogicalServerAdvancedThreatProtectionListResult] + ) + cls: ClsType[_models.LogicalServerAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -123,13 +123,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings" + } @distributed_trace_async async def get( @@ -179,10 +181,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAdvancedThreatProtection] + ) + cls: ClsType[_models.ServerAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -195,9 +197,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -214,7 +216,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } async def _create_or_update_initial( self, @@ -235,11 +239,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerAdvancedThreatProtection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerAdvancedThreatProtection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -263,9 +267,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -284,7 +288,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } @overload async def begin_create_or_update( @@ -413,16 +419,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAdvancedThreatProtection] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + 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, @@ -443,7 +449,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -455,6 +461,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } 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 9b9ec7e40927..bce34f83de0f 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 @@ -88,10 +88,10 @@ async def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[List[_models.Advisor]] + ) + cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) request = build_list_by_server_request( resource_group_name=resource_group_name, @@ -104,9 +104,9 @@ async def list_by_server( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -123,7 +123,9 @@ async def list_by_server( return deserialized - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors" + } @distributed_trace_async async def get( @@ -154,10 +156,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Advisor] + ) + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -170,9 +172,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -189,7 +191,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}" + } @overload async def update( @@ -293,11 +297,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Advisor] + ) + 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 @@ -321,9 +325,9 @@ async def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -340,4 +344,6 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}" + } 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 a43041fd4405..1cc3909b3f46 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 @@ -80,10 +80,10 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAutomaticTuning] + ) + cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -95,9 +95,9 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -114,7 +114,9 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current" + } @overload async def update( @@ -209,11 +211,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAutomaticTuning] + ) + 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 @@ -236,9 +238,9 @@ async def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -255,4 +257,6 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current" + } 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 4c21181e6e28..c123c4083dfe 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 @@ -98,10 +98,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAzureADAdministrator] + ) + cls: ClsType[_models.ServerAzureADAdministrator] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -114,9 +114,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -133,7 +133,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } async def _create_or_update_initial( self, @@ -154,11 +156,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerAzureADAdministrator]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerAzureADAdministrator]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -182,9 +184,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -206,7 +208,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } @overload async def begin_create_or_update( @@ -329,16 +333,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAzureADAdministrator] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, administrator_name=administrator_name, @@ -359,7 +363,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -371,9 +375,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -393,10 +399,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -409,9 +415,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -424,7 +430,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } @distributed_trace_async async def begin_delete( @@ -459,13 +467,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -484,7 +492,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -496,9 +504,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } @distributed_trace def list_by_server( @@ -521,10 +531,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdministratorListResult] + ) + cls: ClsType[_models.AdministratorListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -547,12 +557,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -560,13 +570,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -579,4 +589,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators" + } 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 bf39fc4968a3..21d9e1376e45 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 @@ -98,10 +98,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAzureADOnlyAuthentication] + ) + cls: ClsType[_models.ServerAzureADOnlyAuthentication] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -114,9 +114,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -133,7 +133,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } async def _create_or_update_initial( self, @@ -154,11 +156,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerAzureADOnlyAuthentication]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerAzureADOnlyAuthentication]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -182,9 +184,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -206,7 +208,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } @overload async def begin_create_or_update( @@ -337,16 +341,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAzureADOnlyAuthentication] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, authentication_name=authentication_name, @@ -367,7 +371,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -379,9 +383,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -401,10 +407,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -417,9 +423,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -432,7 +438,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } @distributed_trace_async async def begin_delete( @@ -467,13 +475,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -492,7 +500,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -504,9 +512,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } @distributed_trace def list_by_server( @@ -529,10 +539,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AzureADOnlyAuthListResult] + ) + cls: ClsType[_models.AzureADOnlyAuthListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -555,12 +565,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -568,13 +578,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -587,4 +597,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications" + } 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 c08cd8e2d54d..10d37d5da1e4 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 @@ -84,10 +84,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerBlobAuditingPolicyListResult] + ) + cls: ClsType[_models.ServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -123,13 +123,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings" + } @distributed_trace_async async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _models.ServerBlobAuditingPolicy: @@ -172,11 +174,11 @@ 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 {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerBlobAuditingPolicy] + ) + cls: ClsType[_models.ServerBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -189,9 +191,9 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -208,7 +210,9 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}" + } async def _create_or_update_initial( self, @@ -228,12 +232,12 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerBlobAuditingPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerBlobAuditingPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -257,9 +261,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -278,7 +282,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}" + } @overload async def begin_create_or_update( @@ -398,17 +404,17 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerBlobAuditingPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, parameters=parameters, @@ -429,7 +435,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -441,6 +447,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_communication_links_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_communication_links_operations.py index 8210a13346e7..2f4ed7ad5cf8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_communication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_communication_links_operations.py @@ -93,8 +93,8 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -107,9 +107,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -122,7 +122,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" + } @distributed_trace_async async def get( @@ -153,8 +155,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerCommunicationLink] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServerCommunicationLink] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -167,9 +169,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -186,7 +188,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" + } async def _create_or_update_initial( self, @@ -207,9 +211,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerCommunicationLink]] + api_version: Literal["2014-04-01"] = 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[Optional[_models.ServerCommunicationLink]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -233,9 +237,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -254,7 +258,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" + } @overload async def begin_create_or_update( @@ -374,14 +380,14 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerCommunicationLink] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2014-04-01"] = 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) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, communication_link_name=communication_link_name, @@ -402,7 +408,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -414,9 +420,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" + } @distributed_trace def list_by_server( @@ -438,8 +446,8 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerCommunicationLinkListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServerCommunicationLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -462,12 +470,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -475,13 +483,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -494,4 +502,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks" + } 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 0ac998ec236b..2ef67fabb1d8 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 @@ -96,10 +96,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerConnectionPolicy] + ) + cls: ClsType[_models.ServerConnectionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -112,9 +112,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -131,7 +131,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}" + } async def _create_or_update_initial( self, @@ -152,11 +154,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerConnectionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerConnectionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -180,9 +182,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -201,7 +203,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}" + } @overload async def begin_create_or_update( @@ -321,16 +325,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerConnectionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, connection_policy_name=connection_policy_name, @@ -351,7 +355,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -363,9 +367,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}" + } @distributed_trace def list_by_server( @@ -387,10 +393,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerConnectionPolicyListResult] + ) + cls: ClsType[_models.ServerConnectionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -413,12 +419,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -426,13 +432,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -445,4 +451,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies" + } 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 df1f6b7b7591..f31474761b72 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 @@ -84,10 +84,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDevOpsAuditSettingsListResult] + ) + cls: ClsType[_models.ServerDevOpsAuditSettingsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,12 +110,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -123,13 +123,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -142,7 +142,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings" + } @distributed_trace_async async def get( @@ -177,10 +179,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDevOpsAuditingSettings] + ) + cls: ClsType[_models.ServerDevOpsAuditingSettings] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -193,9 +195,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -212,7 +214,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" + } async def _create_or_update_initial( self, @@ -233,11 +237,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerDevOpsAuditingSettings]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerDevOpsAuditingSettings]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -261,9 +265,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -282,7 +286,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" + } @overload async def begin_create_or_update( @@ -402,16 +408,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDevOpsAuditingSettings] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + 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, @@ -432,10 +438,10 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -447,6 +453,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" + } 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 438805d2d02d..a8af9ea5617c 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 @@ -94,10 +94,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDnsAlias] + ) + cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -110,9 +110,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -129,7 +129,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } async def _create_or_update_initial( self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any @@ -145,10 +147,10 @@ async def _create_or_update_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerDnsAlias]] + ) + cls: ClsType[Optional[_models.ServerDnsAlias]] = kwargs.pop("cls", None) request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -161,9 +163,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -185,7 +187,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } @distributed_trace_async async def begin_create_or_update( @@ -216,15 +220,15 @@ async def begin_create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDnsAlias] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, dns_alias_name=dns_alias_name, @@ -243,7 +247,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -255,9 +259,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any @@ -273,10 +279,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -289,9 +295,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -304,7 +310,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } @distributed_trace_async async def begin_delete( @@ -334,13 +342,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -359,7 +367,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -371,9 +379,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } @distributed_trace def list_by_server( @@ -394,10 +404,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDnsAliasListResult] + ) + cls: ClsType[_models.ServerDnsAliasListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -420,12 +430,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -433,13 +443,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -452,7 +462,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases" + } async def _acquire_initial( self, @@ -473,11 +485,11 @@ async def _acquire_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerDnsAlias]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -501,9 +513,9 @@ async def _acquire_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -522,7 +534,9 @@ async def _acquire_initial( return deserialized - _acquire_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire"} # type: ignore + _acquire_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire" + } @overload async def begin_acquire( @@ -641,16 +655,16 @@ async def begin_acquire( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDnsAlias] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._acquire_initial( # type: ignore + raw_result = await self._acquire_initial( resource_group_name=resource_group_name, server_name=server_name, dns_alias_name=dns_alias_name, @@ -671,7 +685,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -683,6 +697,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_acquire.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire"} # type: ignore + begin_acquire.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire" + } 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 2dc2e8332421..bb3904fc77ac 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 @@ -83,10 +83,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerKeyListResult] + ) + cls: ClsType[_models.ServerKeyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -109,12 +109,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -122,13 +122,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -141,7 +141,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys" + } @distributed_trace_async async def get(self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any) -> _models.ServerKey: @@ -170,10 +172,10 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerKey] + ) + cls: ClsType[_models.ServerKey] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -186,9 +188,9 @@ async def get(self, resource_group_name: str, server_name: str, key_name: str, * params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -205,7 +207,9 @@ async def get(self, resource_group_name: str, server_name: str, key_name: str, * return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } async def _create_or_update_initial( self, @@ -226,11 +230,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerKey]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerKey]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -254,9 +258,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -278,7 +282,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } @overload async def begin_create_or_update( @@ -407,16 +413,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerKey] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, key_name=key_name, @@ -437,7 +443,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -449,9 +455,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any @@ -467,10 +475,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -483,9 +491,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -498,7 +506,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } @distributed_trace_async async def begin_delete( @@ -528,13 +538,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -553,7 +563,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -565,6 +575,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } 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 b46398e316d0..e8c82072b9a5 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 @@ -75,10 +75,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerOperationListResult] + ) + cls: ClsType[_models.ServerOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -101,12 +101,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -114,13 +114,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -133,4 +133,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/operations"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/operations" + } 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 6748af23d667..a7068dcc9f48 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 @@ -96,10 +96,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerSecurityAlertPolicy] + ) + cls: ClsType[_models.ServerSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -112,9 +112,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -131,7 +131,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" + } async def _create_or_update_initial( self, @@ -152,11 +154,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerSecurityAlertPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerSecurityAlertPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -180,9 +182,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -201,7 +203,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" + } @overload async def begin_create_or_update( @@ -321,16 +325,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerSecurityAlertPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + 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, @@ -351,7 +355,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -363,9 +367,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" + } @distributed_trace def list_by_server( @@ -388,10 +394,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] + ) + cls: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -414,12 +420,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -427,13 +433,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -446,4 +452,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies" + } 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 6feefb61afe7..9b15295a4f77 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 @@ -85,10 +85,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustCertificatesListResult] + ) + cls: ClsType[_models.ServerTrustCertificatesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -111,12 +111,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -124,13 +124,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -143,7 +143,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates" + } @distributed_trace_async async def get( @@ -174,10 +176,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustCertificate] + ) + cls: ClsType[_models.ServerTrustCertificate] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -190,9 +192,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -209,7 +211,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } async def _create_or_update_initial( self, @@ -230,11 +234,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerTrustCertificate]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerTrustCertificate]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -258,9 +262,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -282,7 +286,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } @overload async def begin_create_or_update( @@ -402,16 +408,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustCertificate] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, certificate_name=certificate_name, @@ -432,7 +438,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -444,9 +450,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any @@ -462,10 +470,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -478,9 +486,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -493,7 +501,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } @distributed_trace_async async def begin_delete( @@ -523,13 +533,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -548,7 +558,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -560,6 +570,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } 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 5c3589cc4a65..81145dc0ed7f 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 @@ -94,10 +94,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustGroup] + ) + cls: ClsType[_models.ServerTrustGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -110,9 +110,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -129,7 +129,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } async def _create_or_update_initial( self, @@ -150,11 +152,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerTrustGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerTrustGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -178,9 +180,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -202,7 +204,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } @overload async def begin_create_or_update( @@ -322,16 +326,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + 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, @@ -352,7 +356,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -364,9 +368,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any @@ -382,10 +388,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -398,9 +404,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -413,7 +419,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } @distributed_trace_async async def begin_delete( @@ -443,13 +451,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -468,7 +476,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -480,9 +488,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } @distributed_trace def list_by_location( @@ -503,10 +513,10 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustGroupListResult] + ) + cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -529,12 +539,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -542,13 +552,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -561,7 +571,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups" + } @distributed_trace def list_by_instance( @@ -582,10 +594,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustGroupListResult] + ) + cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -608,12 +620,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -621,13 +633,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -640,4 +652,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustGroups"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustGroups" + } 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 a2266c57b9f3..c33c74a74d92 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 @@ -75,8 +75,8 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerUsageListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServerUsageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -99,12 +99,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -112,13 +112,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -131,4 +131,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages" + } 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 8fb133825cc9..8b9189ff450c 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 @@ -97,10 +97,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessment] + ) + cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -113,9 +113,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -132,7 +132,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload async def create_or_update( @@ -247,11 +249,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessment] + ) + 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 @@ -275,9 +277,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -294,11 +296,13 @@ async def create_or_update( deserialized = self._deserialize("ServerVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -335,10 +339,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -351,9 +355,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -366,7 +370,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def list_by_server( @@ -389,10 +395,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.ServerVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -415,12 +421,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -428,13 +434,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -447,4 +453,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments" + } 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 abb1ee3d3760..017ae2ebb3a8 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 @@ -87,10 +87,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerListResult] + ) + cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -113,12 +113,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -126,13 +126,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -145,7 +145,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers" + } @distributed_trace_async async def get( @@ -176,10 +178,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Server] + ) + cls: ClsType[_models.Server] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -192,9 +194,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -211,7 +213,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } async def _create_or_update_initial( self, resource_group_name: str, server_name: str, parameters: Union[_models.Server, IO], **kwargs: Any @@ -227,11 +231,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Server]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Server]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -254,9 +258,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -278,7 +282,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } @overload async def begin_create_or_update( @@ -385,16 +391,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Server] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, parameters=parameters, @@ -414,7 +420,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -426,9 +432,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, **kwargs: Any @@ -444,10 +452,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -459,9 +467,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -474,7 +482,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } @distributed_trace_async async def begin_delete(self, resource_group_name: str, server_name: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -500,13 +510,13 @@ 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 = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -524,7 +534,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -536,9 +546,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } async def _update_initial( self, resource_group_name: str, server_name: str, parameters: Union[_models.ServerUpdate, IO], **kwargs: Any @@ -554,11 +566,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Server]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Server]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -581,9 +593,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -602,7 +614,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } @overload async def begin_update( @@ -709,16 +723,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Server] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, server_name=server_name, parameters=parameters, @@ -738,7 +752,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -750,9 +764,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } @distributed_trace def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_models.Server"]: @@ -768,10 +784,10 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerListResult] + ) + cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -793,12 +809,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -806,13 +822,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -825,7 +841,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers"} async def _import_database_initial( self, @@ -845,11 +861,11 @@ async def _import_database_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ImportExportOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -872,9 +888,9 @@ async def _import_database_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -893,7 +909,9 @@ async def _import_database_initial( return deserialized - _import_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import"} # type: ignore + _import_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import" + } @overload async def begin_import_database( @@ -1004,16 +1022,16 @@ async def begin_import_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._import_database_initial( # type: ignore + raw_result = await self._import_database_initial( resource_group_name=resource_group_name, server_name=server_name, parameters=parameters, @@ -1033,7 +1051,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1045,9 +1063,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_import_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import"} # type: ignore + begin_import_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import" + } @overload async def check_name_availability( @@ -1111,11 +1131,11 @@ async def check_name_availability( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CheckNameAvailabilityResponse] + ) + 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 @@ -1136,9 +1156,9 @@ async def check_name_availability( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1155,4 +1175,6 @@ async def check_name_availability( return deserialized - check_name_availability.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability"} # type: ignore + check_name_availability.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py index 9198deb104ef..17841b39b4b9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py @@ -86,8 +86,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceObjective] + api_version: Literal["2014-04-01"] = 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, @@ -100,9 +100,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -119,7 +119,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives/{serviceObjectiveName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives/{serviceObjectiveName}" + } @distributed_trace def list_by_server( @@ -140,8 +142,8 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceObjectiveListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServiceObjectiveListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -164,12 +166,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -177,13 +179,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ServiceObjectiveListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -196,4 +198,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives" + } 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 68827ecc256c..2069ecac3e81 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 @@ -82,10 +82,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlAgentConfiguration] + ) + cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -97,9 +97,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -116,7 +116,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current" + } @overload async def create_or_update( @@ -210,11 +212,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlAgentConfiguration] + ) + 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 @@ -237,9 +239,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -256,4 +258,6 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current" + } 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 3da48cc28d89..78ceafb8b658 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 @@ -91,13 +91,13 @@ def list_by_sql_vulnerability_assessment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -122,12 +122,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -137,13 +137,13 @@ async def extract_data(pipeline_response): ) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -156,7 +156,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_sql_vulnerability_assessment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines"} # type: ignore + list_by_sql_vulnerability_assessment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines" + } @distributed_trace_async async def get( @@ -198,13 +200,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -219,9 +221,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -238,4 +240,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + } 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 549585ee8305..0bb34bfef106 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 @@ -180,14 +180,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + ) + 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 @@ -213,9 +213,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -232,4 +232,6 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + } 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 5d29196ac34a..b23cae70124b 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 @@ -75,13 +75,13 @@ async def _execute_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_execute_request( resource_group_name=resource_group_name, @@ -95,9 +95,9 @@ async def _execute_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -110,7 +110,9 @@ async def _execute_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _execute_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan"} # type: ignore + _execute_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + } @distributed_trace_async async def begin_execute( @@ -148,16 +150,16 @@ async def begin_execute( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._execute_initial( # type: ignore resource_group_name=resource_group_name, @@ -177,7 +179,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -189,6 +191,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_execute.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan"} # type: ignore + begin_execute.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + } 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 5c9f8172f5d5..a55a03ba8d57 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 @@ -95,13 +95,13 @@ def list_by_baseline( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -127,12 +127,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -142,13 +142,13 @@ async def extract_data(pipeline_response): ) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -161,7 +161,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_baseline.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules"} # type: ignore + list_by_baseline.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules" + } @distributed_trace_async async def get( @@ -206,13 +208,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -228,9 +230,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -247,7 +249,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } @overload async def create_or_update( @@ -382,14 +386,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + ) + 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 @@ -416,9 +420,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -435,4 +439,6 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } 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 97fd4ab6c493..7eaaa39099d2 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 @@ -98,13 +98,13 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -120,9 +120,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -135,4 +135,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } 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 0830ba0da739..10b203067a05 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 @@ -96,13 +96,13 @@ def list_by_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] + ) + cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -128,12 +128,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -141,13 +141,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -160,7 +160,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_scan.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults"} # type: ignore + list_by_scan.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults" + } @distributed_trace_async async def get( @@ -207,13 +209,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanResults] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -229,9 +231,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -248,4 +250,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}" + } 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 581adb04c3e1..4c55f5647006 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 @@ -91,13 +91,13 @@ def list_by_sql_vulnerability_assessments( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -122,12 +122,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -135,13 +135,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -154,7 +154,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_sql_vulnerability_assessments.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans"} # type: ignore + list_by_sql_vulnerability_assessments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + } @distributed_trace_async async def get( @@ -196,13 +198,13 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -217,9 +219,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -236,4 +238,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + } 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 14396137fd64..e27662dc48f5 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 @@ -89,10 +89,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -105,9 +105,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -120,4 +120,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + } 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 2789bff969d9..5e55adb6c080 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 @@ -82,10 +82,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -108,12 +108,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -121,13 +121,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -140,7 +140,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments" + } @distributed_trace_async async def get( @@ -177,10 +179,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessment] + ) + cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -193,9 +195,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -212,7 +214,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload async def create_or_update( @@ -318,11 +322,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessment] + ) + 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 @@ -346,9 +350,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -365,8 +369,10 @@ async def create_or_update( deserialized = self._deserialize("SqlVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + } 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 92dc786ea800..55416cea7820 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 @@ -71,10 +71,10 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncIterable[" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SubscriptionUsageListResult] + ) + cls: ClsType[_models.SubscriptionUsageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -96,12 +96,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -109,13 +109,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -128,7 +128,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages" + } @distributed_trace_async async def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.SubscriptionUsage: @@ -154,10 +156,10 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SubscriptionUsage] + ) + cls: ClsType[_models.SubscriptionUsage] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -169,9 +171,9 @@ async def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _mode params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -188,4 +190,6 @@ async def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _mode return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}" + } 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 5faaef57452f..78d6c122131f 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 @@ -78,10 +78,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SynapseLinkWorkspaceListResult] + ) + cls: ClsType[_models.SynapseLinkWorkspaceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -105,12 +105,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -118,13 +118,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -137,4 +137,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/linkWorkspaces"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/linkWorkspaces" + } 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 a7a2ca0fe5fc..33e34f578688 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 @@ -95,10 +95,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgent] + ) + cls: ClsType[_models.SyncAgent] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -111,9 +111,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -130,7 +130,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } async def _create_or_update_initial( self, @@ -151,11 +153,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncAgent]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -179,9 +181,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -203,7 +205,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } @overload async def begin_create_or_update( @@ -323,16 +327,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgent] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, sync_agent_name=sync_agent_name, @@ -353,7 +357,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -365,9 +369,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any @@ -383,10 +389,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -399,9 +405,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -414,7 +420,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } @distributed_trace_async async def begin_delete( @@ -444,13 +452,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -469,7 +477,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -481,9 +489,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } @distributed_trace def list_by_server( @@ -504,10 +514,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgentListResult] + ) + cls: ClsType[_models.SyncAgentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -530,12 +540,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -543,13 +553,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -562,7 +572,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents" + } @distributed_trace_async async def generate_key( @@ -593,10 +605,10 @@ async def generate_key( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgentKeyProperties] + ) + cls: ClsType[_models.SyncAgentKeyProperties] = kwargs.pop("cls", None) request = build_generate_key_request( resource_group_name=resource_group_name, @@ -609,9 +621,9 @@ async def generate_key( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -628,7 +640,9 @@ async def generate_key( return deserialized - generate_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/generateKey"} # type: ignore + generate_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/generateKey" + } @distributed_trace def list_linked_databases( @@ -652,10 +666,10 @@ def list_linked_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgentLinkedDatabaseListResult] + ) + cls: ClsType[_models.SyncAgentLinkedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -679,12 +693,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -692,13 +706,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -711,4 +725,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_linked_databases.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/linkedDatabases"} # type: ignore + list_linked_databases.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/linkedDatabases" + } 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 b09f6b2a6e19..1e7d07fd311b 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 @@ -89,10 +89,10 @@ def list_sync_database_ids( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncDatabaseIdListResult] + ) + cls: ClsType[_models.SyncDatabaseIdListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -114,12 +114,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -127,13 +127,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -146,7 +146,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_sync_database_ids.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds"} # type: ignore + list_sync_database_ids.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds" + } async def _refresh_hub_schema_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any @@ -162,10 +164,10 @@ async def _refresh_hub_schema_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_refresh_hub_schema_request( resource_group_name=resource_group_name, @@ -179,9 +181,9 @@ async def _refresh_hub_schema_initial( # pylint: disable=inconsistent-return-st params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -194,7 +196,9 @@ async def _refresh_hub_schema_initial( # pylint: disable=inconsistent-return-st if cls: return cls(pipeline_response, None, {}) - _refresh_hub_schema_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema"} # type: ignore + _refresh_hub_schema_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema" + } @distributed_trace_async async def begin_refresh_hub_schema( @@ -226,13 +230,13 @@ async def begin_refresh_hub_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._refresh_hub_schema_initial( # type: ignore resource_group_name=resource_group_name, @@ -252,7 +256,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -264,9 +268,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_refresh_hub_schema.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema"} # type: ignore + begin_refresh_hub_schema.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema" + } @distributed_trace def list_hub_schemas( @@ -293,10 +299,10 @@ def list_hub_schemas( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncFullSchemaPropertiesListResult] + ) + cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -321,12 +327,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -334,13 +340,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -353,7 +359,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_hub_schemas.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas"} # type: ignore + list_hub_schemas.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas" + } @distributed_trace def list_logs( @@ -398,10 +406,10 @@ def list_logs( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroupLogListResult] + ) + cls: ClsType[_models.SyncGroupLogListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -430,12 +438,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -443,13 +451,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -462,7 +470,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs"} # type: ignore + list_logs.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs" + } @distributed_trace_async async def cancel_sync( # pylint: disable=inconsistent-return-statements @@ -495,10 +505,10 @@ async def cancel_sync( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_sync_request( resource_group_name=resource_group_name, @@ -512,9 +522,9 @@ async def cancel_sync( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -527,7 +537,9 @@ async def cancel_sync( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel_sync.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync"} # type: ignore + cancel_sync.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync" + } @distributed_trace_async async def trigger_sync( # pylint: disable=inconsistent-return-statements @@ -560,10 +572,10 @@ async def trigger_sync( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_trigger_sync_request( resource_group_name=resource_group_name, @@ -577,9 +589,9 @@ async def trigger_sync( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -592,7 +604,9 @@ async def trigger_sync( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - trigger_sync.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync"} # type: ignore + trigger_sync.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync" + } @distributed_trace_async async def get( @@ -625,10 +639,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroup] + ) + cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -642,9 +656,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -661,7 +675,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } async def _create_or_update_initial( self, @@ -683,11 +699,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -712,9 +728,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -736,7 +752,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } @overload async def begin_create_or_update( @@ -865,16 +883,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -896,7 +914,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -908,9 +926,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any @@ -926,10 +946,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -943,9 +963,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -958,7 +978,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } @distributed_trace_async async def begin_delete( @@ -990,13 +1012,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -1016,7 +1038,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1028,9 +1050,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } async def _update_initial( self, @@ -1052,11 +1076,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1081,9 +1105,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1102,7 +1126,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } @overload async def begin_update( @@ -1231,16 +1257,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1262,7 +1288,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1274,9 +1300,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } @distributed_trace def list_by_database( @@ -1299,10 +1327,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroupListResult] + ) + cls: ClsType[_models.SyncGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1326,12 +1354,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1339,13 +1367,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1358,4 +1386,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups" + } 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 f7bc5afa4a41..81bf04aa8585 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 @@ -107,10 +107,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncMember] + ) + cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -125,9 +125,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -144,7 +144,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } async def _create_or_update_initial( self, @@ -167,11 +169,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncMember]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncMember]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -197,9 +199,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -221,7 +223,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } @overload async def begin_create_or_update( @@ -362,16 +366,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncMember] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -394,7 +398,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -406,9 +410,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -430,10 +436,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -448,9 +454,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -463,7 +469,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } @distributed_trace_async async def begin_delete( @@ -504,13 +512,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -531,7 +539,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -543,9 +551,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } async def _update_initial( self, @@ -568,11 +578,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncMember]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncMember]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -598,9 +608,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -619,7 +629,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } @overload async def begin_update( @@ -760,16 +772,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncMember] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -792,7 +804,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -804,9 +816,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } @distributed_trace def list_by_sync_group( @@ -831,10 +845,10 @@ def list_by_sync_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncMemberListResult] + ) + cls: ClsType[_models.SyncMemberListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -859,12 +873,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -872,13 +886,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -891,7 +905,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_sync_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers"} # type: ignore + list_by_sync_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers" + } @distributed_trace def list_member_schemas( @@ -927,10 +943,10 @@ def list_member_schemas( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncFullSchemaPropertiesListResult] + ) + cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -956,12 +972,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -969,13 +985,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -988,7 +1004,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_member_schemas.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas"} # type: ignore + list_member_schemas.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas" + } async def _refresh_member_schema_initial( # pylint: disable=inconsistent-return-statements self, @@ -1010,10 +1028,10 @@ async def _refresh_member_schema_initial( # pylint: disable=inconsistent-return _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_refresh_member_schema_request( resource_group_name=resource_group_name, @@ -1028,9 +1046,9 @@ async def _refresh_member_schema_initial( # pylint: disable=inconsistent-return params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1043,7 +1061,9 @@ async def _refresh_member_schema_initial( # pylint: disable=inconsistent-return if cls: return cls(pipeline_response, None, {}) - _refresh_member_schema_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema"} # type: ignore + _refresh_member_schema_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema" + } @distributed_trace_async async def begin_refresh_member_schema( @@ -1084,13 +1104,13 @@ async def begin_refresh_member_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._refresh_member_schema_initial( # type: ignore resource_group_name=resource_group_name, @@ -1111,7 +1131,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1123,6 +1143,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_refresh_member_schema.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema"} # type: ignore + begin_refresh_member_schema.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema" + } 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 9984ae142314..5950ddbaad09 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 @@ -71,11 +71,11 @@ async def _create_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -98,9 +98,9 @@ async def _create_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -113,7 +113,9 @@ async def _create_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates" + } @overload async def begin_create( @@ -217,14 +219,14 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._create_initial( # type: ignore resource_group_name=resource_group_name, @@ -244,7 +246,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -256,6 +258,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates" + } 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 8bde9cbbe83d..385dac81007b 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 @@ -71,10 +71,10 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncIterable[" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TimeZoneListResult] + ) + cls: ClsType[_models.TimeZoneListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -96,12 +96,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -109,13 +109,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -128,7 +128,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones" + } @distributed_trace_async async def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.TimeZone: @@ -154,10 +156,10 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TimeZone] + ) + cls: ClsType[_models.TimeZone] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -169,9 +171,9 @@ async def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _mo params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -188,4 +190,6 @@ async def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _mo return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId}" + } 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 db0fc255b7b8..6d12c29fb4c3 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 @@ -98,10 +98,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LogicalDatabaseTransparentDataEncryption] + ) + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -115,9 +115,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -134,7 +134,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + } @overload async def create_or_update( @@ -250,11 +252,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogicalDatabaseTransparentDataEncryption]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LogicalDatabaseTransparentDataEncryption]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -279,9 +281,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -303,7 +305,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + } @distributed_trace def list_by_database( @@ -329,10 +333,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LogicalDatabaseTransparentDataEncryptionListResult] + ) + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryptionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -356,12 +360,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -369,13 +373,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -388,4 +392,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption" + } 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 e50d4ffd6bc8..665cfb7aa068 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 @@ -78,10 +78,10 @@ def list_by_instance_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsageListResult] + ) + cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -105,12 +105,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -118,13 +118,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -137,4 +137,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_instance_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/usages"} # type: ignore + list_by_instance_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/usages" + } 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 db6ae7a4c8ca..322ed6a33f48 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 @@ -78,10 +78,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.VirtualCluster"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualClusterListResult] + ) + cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -102,12 +102,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -115,13 +115,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -134,7 +134,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters"} @distributed_trace def list_by_resource_group( @@ -153,10 +153,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualClusterListResult] + ) + cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -178,12 +178,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -191,13 +191,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -210,7 +210,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters" + } @distributed_trace_async async def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any) -> _models.VirtualCluster: @@ -237,10 +239,10 @@ 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 = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualCluster] + ) + cls: ClsType[_models.VirtualCluster] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -252,9 +254,9 @@ async def get(self, resource_group_name: str, virtual_cluster_name: str, **kwarg params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -271,7 +273,9 @@ async def get(self, resource_group_name: str, virtual_cluster_name: str, **kwarg return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any @@ -287,10 +291,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -302,9 +306,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -317,7 +321,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } @distributed_trace_async async def begin_delete( @@ -345,13 +351,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -369,7 +375,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -381,9 +387,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } async def _update_initial( self, @@ -403,11 +411,11 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualCluster]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualCluster]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -430,9 +438,9 @@ async def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -451,7 +459,9 @@ async def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } @overload async def begin_update( @@ -562,16 +572,16 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualCluster] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( # type: ignore + raw_result = await self._update_initial( resource_group_name=resource_group_name, virtual_cluster_name=virtual_cluster_name, parameters=parameters, @@ -591,7 +601,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -603,9 +613,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } async def _update_dns_servers_initial( self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any @@ -621,10 +633,10 @@ async def _update_dns_servers_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.UpdateVirtualClusterDnsServersOperation]] + ) + cls: ClsType[Optional[_models.UpdateVirtualClusterDnsServersOperation]] = kwargs.pop("cls", None) request = build_update_dns_servers_request( resource_group_name=resource_group_name, @@ -636,9 +648,9 @@ async def _update_dns_servers_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -657,7 +669,9 @@ async def _update_dns_servers_initial( return deserialized - _update_dns_servers_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers"} # type: ignore + _update_dns_servers_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers" + } @distributed_trace_async async def begin_update_dns_servers( @@ -688,15 +702,15 @@ async def begin_update_dns_servers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateVirtualClusterDnsServersOperation] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_dns_servers_initial( # type: ignore + raw_result = await self._update_dns_servers_initial( resource_group_name=resource_group_name, virtual_cluster_name=virtual_cluster_name, api_version=api_version, @@ -714,7 +728,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -726,6 +740,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_dns_servers.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers"} # type: ignore + begin_update_dns_servers.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers" + } 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 149c75a2a50d..932007621a74 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 @@ -93,10 +93,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualNetworkRule] + ) + cls: ClsType[_models.VirtualNetworkRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -109,9 +109,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -128,7 +128,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } async def _create_or_update_initial( self, @@ -149,11 +151,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualNetworkRule]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualNetworkRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -177,9 +179,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -201,7 +203,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } @overload async def begin_create_or_update( @@ -321,16 +325,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualNetworkRule] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + 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, @@ -351,7 +355,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -363,9 +367,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any @@ -381,10 +387,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -397,9 +403,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -412,7 +418,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } @distributed_trace_async async def begin_delete( @@ -442,13 +450,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -467,7 +475,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -479,9 +487,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } @distributed_trace def list_by_server( @@ -502,10 +512,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualNetworkRuleListResult] + ) + cls: ClsType[_models.VirtualNetworkRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -528,12 +538,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -541,13 +551,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -560,4 +570,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules" + } 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 3e66b73de037..356d2366dc48 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 @@ -104,10 +104,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadClassifier] + ) + cls: ClsType[_models.WorkloadClassifier] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -122,9 +122,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -141,7 +141,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } async def _create_or_update_initial( self, @@ -164,11 +166,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.WorkloadClassifier]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.WorkloadClassifier]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -194,9 +196,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -218,7 +220,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } @overload async def begin_create_or_update( @@ -362,16 +366,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadClassifier] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -394,7 +398,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -406,9 +410,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -430,10 +436,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -448,9 +454,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -463,7 +469,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } @distributed_trace_async async def begin_delete( @@ -504,13 +512,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -531,7 +539,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -543,9 +551,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } @distributed_trace def list_by_workload_group( @@ -571,10 +581,10 @@ def list_by_workload_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadClassifierListResult] + ) + cls: ClsType[_models.WorkloadClassifierListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -599,12 +609,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -612,13 +622,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -631,4 +641,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_workload_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers"} # type: ignore + list_by_workload_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers" + } 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 ac3e15e4dd45..a41f1f694d4a 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 @@ -95,10 +95,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadGroup] + ) + cls: ClsType[_models.WorkloadGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -112,9 +112,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -131,7 +131,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } async def _create_or_update_initial( self, @@ -153,11 +155,11 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.WorkloadGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.WorkloadGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -182,9 +184,9 @@ async def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -206,7 +208,9 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } @overload async def begin_create_or_update( @@ -335,16 +339,16 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( # type: ignore + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -366,7 +370,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -378,9 +382,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any @@ -396,10 +402,10 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -413,9 +419,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -428,7 +434,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } @distributed_trace_async async def begin_delete( @@ -460,13 +468,13 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -486,7 +494,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -498,9 +506,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } @distributed_trace def list_by_database( @@ -523,10 +533,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadGroupListResult] + ) + cls: ClsType[_models.WorkloadGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -550,12 +560,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -563,13 +573,13 @@ 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) + 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) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -582,4 +592,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups" + } 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 097acf993df3..db441b90db83 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 @@ -405,6 +405,7 @@ from ._sql_management_client_enums import AdvancedThreatProtectionState from ._sql_management_client_enums import AdvisorStatus from ._sql_management_client_enums import AggregationFunctionType +from ._sql_management_client_enums import AlwaysEncryptedEnclaveType from ._sql_management_client_enums import AuthenticationName from ._sql_management_client_enums import AutoExecuteStatus from ._sql_management_client_enums import AutoExecuteStatusInheritedFrom @@ -545,7 +546,7 @@ from ._sql_management_client_enums import VulnerabilityAssessmentScanState from ._sql_management_client_enums import VulnerabilityAssessmentScanTriggerType from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -947,6 +948,7 @@ "AdvancedThreatProtectionState", "AdvisorStatus", "AggregationFunctionType", + "AlwaysEncryptedEnclaveType", "AuthenticationName", "AutoExecuteStatus", "AutoExecuteStatusInheritedFrom", 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 d0d0e0776df5..ff66772cd7b1 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 @@ -963,6 +963,9 @@ class Database(TrackedResource): # pylint: disable=too-many-instance-attributes :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 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 source_resource_id: The resource identifier of the source associated with the create operation of this database. @@ -1063,6 +1066,7 @@ class Database(TrackedResource): # pylint: disable=too-many-instance-attributes "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"}, + "preferred_enclave_type": {"key": "properties.preferredEnclaveType", "type": "str"}, "source_resource_id": {"key": "properties.sourceResourceId", "type": "str"}, } @@ -1097,6 +1101,7 @@ def __init__( # pylint: disable=too-many-locals maintenance_configuration_id: Optional[str] = None, is_ledger_on: Optional[bool] = None, federated_client_id: Optional[str] = None, + preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = None, source_resource_id: Optional[str] = None, **kwargs ): @@ -1226,6 +1231,9 @@ def __init__( # pylint: disable=too-many-locals :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 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 source_resource_id: The resource identifier of the source associated with the create operation of this database. @@ -1294,6 +1302,7 @@ def __init__( # pylint: disable=too-many-locals self.is_ledger_on = is_ledger_on self.is_infra_encryption_enabled = None self.federated_client_id = federated_client_id + self.preferred_enclave_type = preferred_enclave_type self.source_resource_id = source_resource_id @@ -2810,6 +2819,9 @@ class DatabaseUpdate(_serialization.Model): # pylint: disable=too-many-instance :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 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 """ _validation = { @@ -2874,6 +2886,7 @@ class DatabaseUpdate(_serialization.Model): # pylint: disable=too-many-instance "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"}, + "preferred_enclave_type": {"key": "properties.preferredEnclaveType", "type": "str"}, } def __init__( # pylint: disable=too-many-locals @@ -2906,6 +2919,7 @@ def __init__( # pylint: disable=too-many-locals maintenance_configuration_id: Optional[str] = None, is_ledger_on: Optional[bool] = None, federated_client_id: Optional[str] = None, + preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = None, **kwargs ): """ @@ -3017,6 +3031,9 @@ def __init__( # pylint: disable=too-many-locals :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 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 """ super().__init__(**kwargs) self.sku = sku @@ -3060,6 +3077,7 @@ def __init__( # pylint: disable=too-many-locals self.is_ledger_on = is_ledger_on self.is_infra_encryption_enabled = None self.federated_client_id = federated_client_id + self.preferred_enclave_type = preferred_enclave_type class DatabaseUsage(ProxyResource): 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 7c254026bc8e..1807954ca421 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 @@ -59,6 +59,13 @@ class AggregationFunctionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SUM = "sum" +class AlwaysEncryptedEnclaveType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of enclave requested on the database i.e. Default or VBS enclaves.""" + + DEFAULT = "Default" + VBS = "VBS" + + class AuthenticationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """AuthenticationName.""" 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 f6785e094a7f..6f4b420e6fd9 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 @@ -183,7 +183,7 @@ from ._virtual_clusters_operations import VirtualClustersOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ 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 fb07e792c840..8d987ea3500a 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 @@ -53,9 +53,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -93,10 +93,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +112,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -136,10 +136,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,7 +155,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -174,9 +174,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +191,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -257,10 +257,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupShortTermRetentionPolicy] + ) + cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -274,9 +274,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -293,7 +293,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } def _create_or_update_initial( self, @@ -315,11 +317,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -344,9 +346,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -365,7 +367,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @overload def begin_create_or_update( @@ -494,16 +498,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupShortTermRetentionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -525,7 +529,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -537,9 +541,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } def _update_initial( self, @@ -561,11 +567,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -590,9 +596,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -611,7 +617,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @overload def begin_update( @@ -740,16 +748,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupShortTermRetentionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -771,7 +779,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -783,9 +791,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_database( @@ -809,10 +819,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.BackupShortTermRetentionPolicyListResult] + ) + cls: ClsType[_models.BackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -836,12 +846,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -849,13 +859,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -868,4 +878,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies" + } 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 153081c68be9..b88f3ea65b95 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 @@ -49,9 +49,9 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_location_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if include is not None: @@ -124,10 +124,10 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LocationCapabilities] + ) + cls: ClsType[_models.LocationCapabilities] = kwargs.pop("cls", None) request = build_list_by_location_request( location_name=location_name, @@ -139,9 +139,9 @@ def list_by_location( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -158,4 +158,6 @@ def list_by_location( return deserialized - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/capabilities"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/capabilities" + } 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 4d2a20a7ea1f..9ff8c50cfbac 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 @@ -45,9 +45,9 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2014-04-01"] = 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)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_create_or_update_request( "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,8 +82,8 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +99,7 @@ def build_get_request( "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -243,10 +243,10 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataMaskingPolicy] + api_version: Literal["2014-04-01"] = 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)) + cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -271,9 +271,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -290,7 +290,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}" + } @distributed_trace def get( @@ -325,9 +327,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataMaskingPolicy] + api_version: Literal["2014-04-01"] = 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, @@ -341,9 +343,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -360,4 +362,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}" + } 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 271c963a780d..ca7d113e7f79 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 @@ -51,9 +51,9 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2014-04-01"] = 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)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +70,7 @@ def build_create_or_update_request( "dataMaskingRuleName": _SERIALIZER.url("data_masking_rule_name", data_masking_rule_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -89,8 +89,8 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +106,7 @@ def build_list_by_database_request( "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -261,10 +261,10 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataMaskingRule] + api_version: Literal["2014-04-01"] = 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)) + cls: ClsType[_models.DataMaskingRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -290,9 +290,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -309,11 +309,13 @@ def create_or_update( deserialized = self._deserialize("DataMaskingRule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}" + } @distributed_trace def list_by_database( @@ -340,9 +342,9 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - data_masking_policy_name = kwargs.pop("data_masking_policy_name", "Default") # type: Literal["Default"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataMaskingRuleListResult] + api_version: Literal["2014-04-01"] = 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 = { 401: ClientAuthenticationError, @@ -367,12 +369,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -380,13 +382,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -399,4 +401,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules" + } 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 378809bfb9f1..a0af9e932ddb 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 @@ -51,9 +51,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -88,9 +88,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -173,10 +173,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataWarehouseUserActivities] + ) + cls: ClsType[_models.DataWarehouseUserActivities] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -190,9 +190,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -209,7 +209,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}" + } @distributed_trace def list_by_database( @@ -233,10 +235,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DataWarehouseUserActivitiesListResult] + ) + cls: ClsType[_models.DataWarehouseUserActivitiesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -260,12 +262,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -273,13 +275,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -292,4 +294,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities" + } 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 bd02add06336..50f456a9f69b 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 @@ -46,9 +46,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,9 +85,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -127,10 +127,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +148,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -202,10 +202,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAdvancedThreatProtectionListResult] + ) + cls: ClsType[_models.DatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -229,12 +229,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -242,13 +242,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -261,7 +261,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings" + } @distributed_trace def get( @@ -301,10 +303,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAdvancedThreatProtection] + ) + cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -318,9 +320,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -337,7 +339,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } @overload def create_or_update( @@ -456,11 +460,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAdvancedThreatProtection] + ) + 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 @@ -485,9 +489,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -504,8 +508,10 @@ def create_or_update( deserialized = self._deserialize("DatabaseAdvancedThreatProtection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } 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 f855eb46d8dc..75e9b3eb2b53 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 @@ -51,9 +51,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -92,9 +92,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +110,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -132,10 +132,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -151,7 +151,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -219,10 +219,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[List[_models.Advisor]] + ) + cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) request = build_list_by_database_request( resource_group_name=resource_group_name, @@ -236,9 +236,9 @@ def list_by_database( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -255,7 +255,9 @@ def list_by_database( return deserialized - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors" + } @distributed_trace def get( @@ -288,10 +290,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Advisor] + ) + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -305,9 +307,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -324,7 +326,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}" + } @overload def update( @@ -437,11 +441,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Advisor] + ) + 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 @@ -466,9 +470,9 @@ def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -485,4 +489,6 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}" + } 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 5f79cdb8a612..7426d1aeb267 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 @@ -45,9 +45,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -79,10 +79,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -158,10 +158,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAutomaticTuning] + ) + cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -174,9 +174,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -193,7 +193,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current" + } @overload def update( @@ -297,11 +299,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseAutomaticTuning] + ) + 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 @@ -325,9 +327,9 @@ def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -344,4 +346,6 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current" + } 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 6d6b47e1caa4..21268097feb5 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 @@ -46,9 +46,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,10 +80,10 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +99,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,11 +116,11 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +136,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -190,10 +190,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseBlobAuditingPolicyListResult] + ) + cls: ClsType[_models.DatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -217,12 +217,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -230,13 +230,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -249,7 +249,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings" + } @distributed_trace def get( @@ -283,11 +285,11 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseBlobAuditingPolicy] + ) + cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -301,9 +303,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -320,7 +322,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}" + } @overload def create_or_update( @@ -433,12 +437,12 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseBlobAuditingPolicy] + ) + 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 @@ -463,9 +467,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -482,8 +486,10 @@ def create_or_update( deserialized = self._deserialize("DatabaseBlobAuditingPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}" + } 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 90a4ff406b78..3dd9fc8699ab 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 @@ -56,9 +56,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if schema is not None: @@ -108,9 +108,9 @@ def build_list_by_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +127,7 @@ def build_list_by_table_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -153,9 +153,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +173,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -244,10 +244,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumnListResult] + ) + cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -276,12 +276,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -289,13 +289,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -308,7 +308,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/columns"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/columns" + } @distributed_trace def list_by_table( @@ -345,10 +347,10 @@ def list_by_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumnListResult] + ) + cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -375,12 +377,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -388,13 +390,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -407,7 +409,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns"} # type: ignore + list_by_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns" + } @distributed_trace def get( @@ -451,10 +455,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumn] + ) + cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -470,9 +474,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -489,4 +493,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}" + } 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 4cfe2ec4e89e..a6995987fa5c 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 @@ -52,9 +52,9 @@ def build_get_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -68,7 +68,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -87,10 +87,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +106,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -125,9 +125,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -142,7 +142,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -203,10 +203,10 @@ def get( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -220,9 +220,9 @@ def get( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -235,7 +235,9 @@ def get( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}" + } def _create_or_update_initial( self, @@ -257,11 +259,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ImportExportExtensionsOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ImportExportExtensionsOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -286,9 +288,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -307,7 +309,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}" + } @overload def begin_create_or_update( @@ -439,16 +443,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportExtensionsOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -470,7 +474,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -482,9 +486,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}" + } @distributed_trace def list_by_database( @@ -509,10 +515,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportExtensionsOperationListResult] + ) + cls: ClsType[_models.ImportExportExtensionsOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -536,12 +542,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -549,13 +555,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -568,4 +574,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions" + } 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 db676e7aaef9..7cc49f972663 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 @@ -50,9 +50,9 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +66,7 @@ def build_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,9 +80,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -158,10 +158,10 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -175,9 +175,9 @@ def cancel( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -190,7 +190,9 @@ def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations/{operationId}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations/{operationId}/cancel" + } @distributed_trace def list_by_database( @@ -213,10 +215,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseOperationListResult] + ) + cls: ClsType[_models.DatabaseOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -240,12 +242,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -253,13 +255,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -272,4 +274,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations" + } 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 cb73d67abc6e..54f4d3bcb8c5 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 @@ -50,9 +50,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_list_by_database_advisor_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -91,9 +91,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +110,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -133,10 +133,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +153,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -216,10 +216,10 @@ def list_by_database_advisor( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[List[_models.RecommendedAction]] + ) + cls: ClsType[List[_models.RecommendedAction]] = kwargs.pop("cls", None) request = build_list_by_database_advisor_request( resource_group_name=resource_group_name, @@ -233,9 +233,9 @@ def list_by_database_advisor( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -252,7 +252,9 @@ def list_by_database_advisor( return deserialized - list_by_database_advisor.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions"} # type: ignore + list_by_database_advisor.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions" + } @distributed_trace def get( @@ -293,10 +295,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecommendedAction] + ) + cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -311,9 +313,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -330,7 +332,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}" + } @overload def update( @@ -452,11 +456,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecommendedAction] + ) + 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" _json = None @@ -482,9 +486,9 @@ def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -501,4 +505,6 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}" + } 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 32000519e870..91cd0120cd19 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 @@ -52,9 +52,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -93,9 +93,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +111,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -170,10 +170,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSchemaListResult] + ) + cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -198,12 +198,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -211,13 +211,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -230,7 +230,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas" + } @distributed_trace def get( @@ -263,10 +265,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSchema] + ) + cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -280,9 +282,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -299,4 +301,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}" + } 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 0442feadc297..a2c944af9b17 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 @@ -51,9 +51,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -91,10 +91,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +110,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -129,9 +129,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -213,10 +213,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSecurityAlertPolicy] + ) + cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -230,9 +230,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -249,7 +249,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + } @overload def create_or_update( @@ -365,11 +367,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSecurityAlertPolicy] + ) + 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 @@ -394,9 +396,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -413,11 +415,13 @@ def create_or_update( deserialized = self._deserialize("DatabaseSecurityAlertPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + } @distributed_trace def list_by_database( @@ -442,10 +446,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSecurityAlertListResult] + ) + cls: ClsType[_models.DatabaseSecurityAlertListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -469,12 +473,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -482,13 +486,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -501,4 +505,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies" + } 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 3063eb15f68a..94aaf2799d03 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 @@ -51,9 +51,9 @@ def build_list_by_sql_vulnerability_assessment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_list_by_sql_vulnerability_assessment_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -94,9 +94,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,7 +115,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -138,10 +138,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -160,7 +160,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -223,10 +223,10 @@ def list_by_sql_vulnerability_assessment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -251,12 +251,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -266,13 +266,13 @@ def extract_data(pipeline_response): ) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -285,7 +285,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_sql_vulnerability_assessment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines"} # type: ignore + list_by_sql_vulnerability_assessment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines" + } @distributed_trace def get( @@ -327,10 +329,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -345,9 +347,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -364,7 +366,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + } @overload def create_or_update( @@ -491,11 +495,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + ) + 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 @@ -521,9 +525,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -540,4 +544,6 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + } 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 b306ed90b0c8..4721501eb620 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 @@ -51,9 +51,9 @@ def build_execute_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -69,7 +69,7 @@ def build_execute_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -115,10 +115,10 @@ def _execute_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_execute_request( resource_group_name=resource_group_name, @@ -132,9 +132,9 @@ def _execute_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -147,7 +147,9 @@ def _execute_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _execute_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan"} # type: ignore + _execute_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + } @distributed_trace def begin_execute( @@ -185,13 +187,13 @@ def begin_execute( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._execute_initial( # type: ignore resource_group_name=resource_group_name, @@ -211,7 +213,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -223,6 +225,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_execute.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan"} # type: ignore + begin_execute.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + } 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 a4dde10cb84d..4e0dca1ad673 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 @@ -52,9 +52,9 @@ def build_list_by_baseline_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_list_by_baseline_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -97,9 +97,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -119,7 +119,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -143,10 +143,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +166,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -191,9 +191,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -211,7 +211,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -272,10 +272,10 @@ def list_by_baseline( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -301,12 +301,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -316,13 +316,13 @@ def extract_data(pipeline_response): ) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -335,7 +335,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_baseline.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules"} # type: ignore + list_by_baseline.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules" + } @distributed_trace def get( @@ -380,10 +382,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -399,9 +401,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -418,7 +420,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } @overload def create_or_update( @@ -553,11 +557,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + ) + 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 @@ -584,9 +588,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -603,7 +607,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -648,10 +654,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -667,9 +673,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -682,4 +688,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } 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 2355714b5b00..ca71ecc4a643 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 @@ -52,9 +52,9 @@ def build_list_by_scan_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_list_by_scan_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -97,9 +97,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -119,7 +119,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -185,10 +185,10 @@ def list_by_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] + ) + cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -214,12 +214,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -227,13 +227,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -246,7 +246,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_scan.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults"} # type: ignore + list_by_scan.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults" + } @distributed_trace def get( @@ -293,10 +295,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanResults] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -312,9 +314,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -331,4 +333,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}" + } 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 f95db93119a3..f66acfc1fd9d 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 @@ -51,9 +51,9 @@ def build_list_by_sql_vulnerability_assessments_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_list_by_sql_vulnerability_assessments_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -94,9 +94,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,7 +115,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -176,10 +176,10 @@ def list_by_sql_vulnerability_assessments( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -204,12 +204,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -217,13 +217,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -236,7 +236,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_sql_vulnerability_assessments.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans"} # type: ignore + list_by_sql_vulnerability_assessments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + } @distributed_trace def get( @@ -278,10 +280,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -296,9 +298,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -315,4 +317,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + } 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 171a084ba1a1..15eeea8e771a 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 @@ -46,9 +46,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,9 +85,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -157,10 +157,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -184,12 +184,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -197,13 +197,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -216,7 +216,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments" + } @distributed_trace def get( @@ -256,10 +258,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessment] + ) + cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -273,9 +275,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -292,4 +294,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + } 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 d35b3cb4f141..c33ab90d591d 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 @@ -53,9 +53,9 @@ def build_list_by_schema_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_list_by_schema_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -96,9 +96,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,7 +115,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -177,10 +177,10 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseTableListResult] + ) + cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -206,12 +206,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -219,13 +219,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -238,7 +238,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_schema.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables"} # type: ignore + list_by_schema.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables" + } @distributed_trace def get( @@ -279,10 +281,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseTable] + ) + cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -297,9 +299,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -316,4 +318,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}" + } 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 b0165fa5902f..2c97bfd00618 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 @@ -46,9 +46,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -114,10 +114,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseUsageListResult] + ) + cls: ClsType[_models.DatabaseUsageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -141,12 +141,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -154,13 +154,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -173,4 +173,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/usages"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/usages" + } 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 116c152a5ce1..3f0deded38ff 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 @@ -52,9 +52,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -98,10 +98,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,7 +121,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,9 +146,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -166,7 +166,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -239,10 +239,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -258,9 +258,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -277,7 +277,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } @overload def create_or_update( @@ -420,11 +422,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] + ) + 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 @@ -451,9 +453,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -470,7 +472,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -518,10 +522,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -537,9 +541,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -552,4 +556,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } 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 5e9bac0c40b3..d2c23a77b280 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 @@ -53,9 +53,9 @@ def build_initiate_scan_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -72,7 +72,7 @@ def build_initiate_scan_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -91,9 +91,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +111,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -134,9 +134,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,7 +155,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -178,9 +178,9 @@ def build_export_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +199,7 @@ def build_export_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -249,10 +249,10 @@ def _initiate_scan_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_initiate_scan_request( resource_group_name=resource_group_name, @@ -267,9 +267,9 @@ def _initiate_scan_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -282,7 +282,9 @@ def _initiate_scan_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _initiate_scan_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan"} # type: ignore + _initiate_scan_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + } @distributed_trace def begin_initiate_scan( @@ -323,13 +325,13 @@ def begin_initiate_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._initiate_scan_initial( # type: ignore resource_group_name=resource_group_name, @@ -350,7 +352,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -362,9 +364,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_initiate_scan.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan"} # type: ignore + begin_initiate_scan.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + } @distributed_trace def list_by_database( @@ -396,10 +400,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] + ) + cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -424,12 +428,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -437,13 +441,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -456,7 +460,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + } @distributed_trace def get( @@ -498,10 +504,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VulnerabilityAssessmentScanRecord] + ) + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -516,9 +522,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -535,7 +541,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + } @distributed_trace def export( @@ -577,10 +585,10 @@ def export( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) request = build_export_request( resource_group_name=resource_group_name, @@ -595,9 +603,9 @@ def export( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -614,8 +622,10 @@ def export( deserialized = self._deserialize("DatabaseVulnerabilityAssessmentScansExport", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - export.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export"} # type: ignore + export.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export" + } 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 068972528632..bfb80bd0f206 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 @@ -51,9 +51,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -93,10 +93,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,7 +114,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -137,9 +137,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -155,7 +155,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -169,9 +169,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +186,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -254,10 +254,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessment] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -271,9 +271,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -290,7 +290,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload def create_or_update( @@ -408,11 +410,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessment] + ) + 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 @@ -437,9 +439,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -456,11 +458,13 @@ def create_or_update( deserialized = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -500,10 +504,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -517,9 +521,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -532,7 +536,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def list_by_database( @@ -557,10 +563,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -584,12 +590,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -597,13 +603,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -616,4 +622,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments" + } 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 27bffd6073ba..337c5aac4e48 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 @@ -48,7 +48,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_metrics_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,7 +81,7 @@ def build_list_metric_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_list_metric_definitions_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -113,9 +113,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -129,7 +129,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if skip_token is not None: @@ -148,9 +148,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -165,7 +165,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -182,10 +182,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +200,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -218,9 +218,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -233,7 +233,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -247,10 +247,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -265,7 +265,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -284,10 +284,10 @@ def build_export_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -302,7 +302,7 @@ def build_export_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -326,9 +326,9 @@ def build_failover_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -341,7 +341,7 @@ def build_failover_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if replica_type is not None: @@ -357,10 +357,10 @@ def build_import_method_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -375,7 +375,7 @@ def build_import_method_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -394,10 +394,10 @@ def build_rename_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -410,7 +410,7 @@ def build_rename_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -428,9 +428,9 @@ def build_pause_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -445,7 +445,7 @@ def build_pause_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -462,9 +462,9 @@ def build_resume_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -479,7 +479,7 @@ def build_resume_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -495,9 +495,9 @@ def build_upgrade_data_warehouse_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) # Construct URL _url = kwargs.pop( "template_url", @@ -510,7 +510,7 @@ def build_upgrade_data_warehouse_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -524,9 +524,9 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -541,7 +541,7 @@ def build_list_by_elastic_pool_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -558,9 +558,9 @@ def build_list_inaccessible_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -574,7 +574,7 @@ def build_list_inaccessible_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -628,8 +628,8 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -654,12 +654,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -667,13 +667,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -686,7 +686,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics" + } @distributed_trace def list_metric_definitions( @@ -709,8 +711,8 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -734,12 +736,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -747,13 +749,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -766,7 +768,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions" + } @distributed_trace def list_by_server( @@ -789,10 +793,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseListResult] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -816,12 +820,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -829,13 +833,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -848,7 +852,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases" + } @distributed_trace def get(self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any) -> _models.Database: @@ -877,10 +883,10 @@ def get(self, resource_group_name: str, server_name: str, database_name: str, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.Database] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -893,9 +899,9 @@ def get(self, resource_group_name: str, server_name: str, database_name: str, ** params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -912,7 +918,9 @@ def get(self, resource_group_name: str, server_name: str, database_name: str, ** return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } def _create_or_update_initial( self, @@ -933,11 +941,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Database]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -961,9 +969,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -985,7 +993,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } @overload def begin_create_or_update( @@ -1102,16 +1112,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1132,7 +1142,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1144,9 +1154,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -1162,10 +1174,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -1178,9 +1190,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1193,7 +1205,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } @distributed_trace def begin_delete( @@ -1223,13 +1237,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -1248,7 +1262,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1260,9 +1274,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } def _update_initial( self, @@ -1283,11 +1299,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Database]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1311,9 +1327,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1332,7 +1348,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } @overload def begin_update( @@ -1449,16 +1467,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1479,7 +1497,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1491,9 +1509,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + } def _export_initial( self, @@ -1514,11 +1534,11 @@ def _export_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ImportExportOperationResult]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1542,9 +1562,9 @@ def _export_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1563,7 +1583,9 @@ def _export_initial( return deserialized - _export_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export"} # type: ignore + _export_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export" + } @overload def begin_export( @@ -1683,16 +1705,16 @@ def begin_export( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._export_initial( # type: ignore + raw_result = self._export_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1713,7 +1735,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1725,9 +1747,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_export.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export"} # type: ignore + begin_export.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export" + } def _failover_initial( # pylint: disable=inconsistent-return-statements self, @@ -1748,10 +1772,10 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -1765,9 +1789,9 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1780,7 +1804,9 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover" + } @distributed_trace def begin_failover( @@ -1818,13 +1844,13 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._failover_initial( # type: ignore resource_group_name=resource_group_name, @@ -1844,7 +1870,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1856,9 +1882,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover" + } def _import_method_initial( self, @@ -1879,11 +1907,11 @@ def _import_method_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ImportExportOperationResult]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1907,9 +1935,9 @@ def _import_method_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1928,7 +1956,9 @@ def _import_method_initial( return deserialized - _import_method_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import"} # type: ignore + _import_method_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import" + } @overload def begin_import_method( @@ -2048,16 +2078,16 @@ def begin_import_method( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._import_method_initial( # type: ignore + raw_result = self._import_method_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -2078,7 +2108,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2090,9 +2120,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_import_method.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import"} # type: ignore + begin_import_method.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import" + } @overload def rename( # pylint: disable=inconsistent-return-statements @@ -2196,11 +2228,11 @@ 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-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 @@ -2224,9 +2256,9 @@ def rename( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2239,7 +2271,9 @@ def rename( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - rename.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/move"} # type: ignore + rename.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/move" + } def _pause_initial( self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -2255,10 +2289,10 @@ def _pause_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Database]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) request = build_pause_request( resource_group_name=resource_group_name, @@ -2271,9 +2305,9 @@ def _pause_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2292,7 +2326,9 @@ def _pause_initial( return deserialized - _pause_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause"} # type: ignore + _pause_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause" + } @distributed_trace def begin_pause( @@ -2322,15 +2358,15 @@ def begin_pause( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._pause_initial( # type: ignore + raw_result = self._pause_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -2349,7 +2385,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2361,9 +2397,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_pause.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause"} # type: ignore + begin_pause.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause" + } def _resume_initial( self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -2379,10 +2417,10 @@ def _resume_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Database]] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) request = build_resume_request( resource_group_name=resource_group_name, @@ -2395,9 +2433,9 @@ def _resume_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2416,7 +2454,9 @@ def _resume_initial( return deserialized - _resume_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume"} # type: ignore + _resume_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume" + } @distributed_trace def begin_resume( @@ -2446,15 +2486,15 @@ def begin_resume( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Database] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._resume_initial( # type: ignore + raw_result = self._resume_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -2473,7 +2513,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2485,9 +2525,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_resume.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume"} # type: ignore + begin_resume.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume" + } def _upgrade_data_warehouse_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -2503,10 +2545,10 @@ def _upgrade_data_warehouse_initial( # pylint: disable=inconsistent-return-stat _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_upgrade_data_warehouse_request( resource_group_name=resource_group_name, @@ -2519,9 +2561,9 @@ def _upgrade_data_warehouse_initial( # pylint: disable=inconsistent-return-stat params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2534,7 +2576,9 @@ def _upgrade_data_warehouse_initial( # pylint: disable=inconsistent-return-stat if cls: return cls(pipeline_response, None, {}) - _upgrade_data_warehouse_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse"} # type: ignore + _upgrade_data_warehouse_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse" + } @distributed_trace def begin_upgrade_data_warehouse( @@ -2564,13 +2608,13 @@ def begin_upgrade_data_warehouse( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._upgrade_data_warehouse_initial( # type: ignore resource_group_name=resource_group_name, @@ -2589,7 +2633,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2601,9 +2645,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_upgrade_data_warehouse.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse"} # type: ignore + begin_upgrade_data_warehouse.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse" + } @distributed_trace def list_by_elastic_pool( @@ -2626,10 +2672,10 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseListResult] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2653,12 +2699,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2666,13 +2712,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2685,7 +2731,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_elastic_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases"} # type: ignore + list_by_elastic_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases" + } @distributed_trace def list_inaccessible_by_server( @@ -2706,10 +2754,10 @@ def list_inaccessible_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseListResult] + api_version: Literal["2022-05-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-05-01-preview") + ) + cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2732,12 +2780,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2745,13 +2793,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2764,4 +2812,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_inaccessible_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/inaccessibleDatabases"} # type: ignore + list_inaccessible_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/inaccessibleDatabases" + } 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 328968485a7c..862ac55b02a1 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 @@ -46,9 +46,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,7 +57,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -72,9 +72,9 @@ def build_get_request(location_name: str, deleted_server_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +88,7 @@ def build_get_request(location_name: str, deleted_server_name: str, subscription "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -103,9 +103,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,7 +118,7 @@ def build_list_by_location_request(location_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -135,9 +135,9 @@ def build_recover_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -151,7 +151,7 @@ def build_recover_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -193,10 +193,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.DeletedServer"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeletedServerListResult] + ) + cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -217,12 +217,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -230,13 +230,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -249,7 +249,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/deletedServers"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/deletedServers"} @distributed_trace def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _models.DeletedServer: @@ -275,10 +275,10 @@ def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeletedServer] + ) + cls: ClsType[_models.DeletedServer] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -290,9 +290,9 @@ def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _m params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -309,7 +309,9 @@ def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _m return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}" + } @distributed_trace def list_by_location(self, location_name: str, **kwargs: Any) -> Iterable["_models.DeletedServer"]: @@ -325,10 +327,10 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> Iterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeletedServerListResult] + ) + cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -350,12 +352,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -363,13 +365,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -382,7 +384,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers" + } def _recover_initial( self, location_name: str, deleted_server_name: str, **kwargs: Any @@ -398,10 +402,10 @@ def _recover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DeletedServer]] + ) + cls: ClsType[Optional[_models.DeletedServer]] = kwargs.pop("cls", None) request = build_recover_request( location_name=location_name, @@ -413,9 +417,9 @@ def _recover_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -434,7 +438,9 @@ def _recover_initial( return deserialized - _recover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover"} # type: ignore + _recover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover" + } @distributed_trace def begin_recover( @@ -462,15 +468,15 @@ def begin_recover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeletedServer] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._recover_initial( # type: ignore + raw_result = self._recover_initial( location_name=location_name, deleted_server_name=deleted_server_name, api_version=api_version, @@ -488,7 +494,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -500,6 +506,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_recover.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover"} # type: ignore + begin_recover.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover" + } 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 6f9008e6b055..3b4180e0856e 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 @@ -48,9 +48,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,9 +85,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +104,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -125,10 +125,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +145,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -167,9 +167,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -184,7 +184,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -202,10 +202,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,7 +222,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -274,10 +274,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DistributedAvailabilityGroupsListResult] + ) + cls: ClsType[_models.DistributedAvailabilityGroupsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -300,12 +300,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -313,13 +313,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -332,7 +332,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups" + } @distributed_trace def get( @@ -367,10 +369,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DistributedAvailabilityGroup] + ) + cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -383,9 +385,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -402,7 +404,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } def _create_or_update_initial( self, @@ -423,11 +427,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DistributedAvailabilityGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -451,9 +455,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -475,7 +479,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } @overload def begin_create_or_update( @@ -595,16 +601,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DistributedAvailabilityGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + 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, @@ -625,7 +631,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -637,9 +643,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -659,10 +667,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -675,9 +683,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -690,7 +698,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } @distributed_trace def begin_delete( @@ -724,13 +734,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -749,7 +759,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -761,9 +771,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } def _update_initial( self, @@ -784,11 +796,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.DistributedAvailabilityGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -812,9 +824,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -833,7 +845,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } @overload def begin_update( @@ -953,16 +967,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DistributedAvailabilityGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + 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, @@ -983,7 +997,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -995,6 +1009,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py index c204fc08a7e1..2f45f871c1f9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py @@ -46,7 +46,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 = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_by_elastic_pool_request( "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -113,8 +113,8 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPoolActivityListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ElasticPoolActivityListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -138,12 +138,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -151,13 +151,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -170,4 +170,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_elastic_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity"} # type: ignore + list_by_elastic_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py index c2c30f52f2f3..b8c4ae45e9a8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py @@ -46,7 +46,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 = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_by_elastic_pool_request( "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -113,8 +113,8 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPoolDatabaseActivityListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ElasticPoolDatabaseActivityListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -138,12 +138,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -151,13 +151,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -170,4 +170,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_elastic_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity"} # type: ignore + list_by_elastic_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity" + } 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 4ddbb0c2caf5..78ca6c249529 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 @@ -50,9 +50,9 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +66,7 @@ def build_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,9 +80,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_list_by_elastic_pool_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -158,10 +158,10 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -175,9 +175,9 @@ def cancel( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -190,7 +190,9 @@ def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/cancel" + } @distributed_trace def list_by_elastic_pool( @@ -214,10 +216,10 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPoolOperationListResult] + ) + cls: ClsType[_models.ElasticPoolOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -241,12 +243,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -254,13 +256,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -273,4 +275,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_elastic_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations"} # type: ignore + list_by_elastic_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations" + } 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 81676d40bc02..a2f25992f42a 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 @@ -54,7 +54,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_metrics_request( "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -87,7 +87,7 @@ def build_list_metric_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +102,7 @@ def build_list_metric_definitions_request( "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -119,9 +119,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +135,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if skip is not None: @@ -154,9 +154,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +171,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -188,10 +188,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +206,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -224,9 +224,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -239,7 +239,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -253,10 +253,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +271,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -289,9 +289,9 @@ def build_failover_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -304,7 +304,7 @@ def build_failover_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -355,8 +355,8 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -381,12 +381,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -394,13 +394,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -413,7 +413,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metrics.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics"} # type: ignore + list_metrics.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics" + } @distributed_trace def list_metric_definitions( @@ -436,8 +438,8 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MetricDefinitionListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -461,12 +463,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -474,13 +476,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -493,7 +495,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_metric_definitions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions"} # type: ignore + list_metric_definitions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions" + } @distributed_trace def list_by_server( @@ -516,10 +520,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPoolListResult] + ) + cls: ClsType[_models.ElasticPoolListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -543,12 +547,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -556,13 +560,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -575,7 +579,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools" + } @distributed_trace def get( @@ -606,10 +612,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPool] + ) + cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -622,9 +628,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -641,7 +647,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } def _create_or_update_initial( self, @@ -662,11 +670,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ElasticPool]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ElasticPool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -690,9 +698,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -714,7 +722,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } @overload def begin_create_or_update( @@ -833,16 +843,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPool] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, elastic_pool_name=elastic_pool_name, @@ -863,7 +873,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -875,9 +885,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any @@ -893,10 +905,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -909,9 +921,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -924,7 +936,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } @distributed_trace def begin_delete( @@ -954,13 +968,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -979,7 +993,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -991,9 +1005,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } def _update_initial( self, @@ -1014,11 +1030,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ElasticPool]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ElasticPool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1042,9 +1058,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1063,7 +1079,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } @overload def begin_update( @@ -1183,16 +1201,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ElasticPool] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, server_name=server_name, elastic_pool_name=elastic_pool_name, @@ -1213,7 +1231,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1225,9 +1243,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + } def _failover_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any @@ -1243,10 +1263,10 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -1259,9 +1279,9 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1274,7 +1294,9 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover" + } @distributed_trace def begin_failover( @@ -1304,13 +1326,13 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-08-01-preview") - ) # type: Literal["2021-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._failover_initial( # type: ignore resource_group_name=resource_group_name, @@ -1329,7 +1351,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1341,6 +1363,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover" + } 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 61204adc716a..eeb136ca442f 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 @@ -48,9 +48,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,9 +85,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +102,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -123,10 +123,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +141,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,9 +163,9 @@ def build_revalidate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -178,7 +178,7 @@ def build_revalidate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -224,10 +224,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EncryptionProtectorListResult] + ) + cls: ClsType[_models.EncryptionProtectorListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -250,12 +250,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -263,13 +263,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -282,7 +282,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector" + } @distributed_trace def get( @@ -318,10 +320,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EncryptionProtector] + ) + cls: ClsType[_models.EncryptionProtector] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -334,9 +336,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -353,7 +355,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}" + } def _create_or_update_initial( self, @@ -374,11 +378,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.EncryptionProtector]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.EncryptionProtector]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -402,9 +406,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -423,7 +427,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}" + } @overload def begin_create_or_update( @@ -546,16 +552,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EncryptionProtector] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, encryption_protector_name=encryption_protector_name, @@ -576,7 +582,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -588,9 +594,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}" + } def _revalidate_initial( # pylint: disable=inconsistent-return-statements self, @@ -610,10 +618,10 @@ def _revalidate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_revalidate_request( resource_group_name=resource_group_name, @@ -626,9 +634,9 @@ def _revalidate_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -641,7 +649,9 @@ def _revalidate_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _revalidate_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate"} # type: ignore + _revalidate_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate" + } @distributed_trace def begin_revalidate( @@ -676,13 +686,13 @@ def begin_revalidate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._revalidate_initial( # type: ignore resource_group_name=resource_group_name, @@ -701,7 +711,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -713,6 +723,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_revalidate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate"} # type: ignore + begin_revalidate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate" + } 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 86ed6efbd561..4e746c0851c9 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 @@ -46,9 +46,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -79,9 +79,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -145,10 +145,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EndpointCertificateListResult] + ) + cls: ClsType[_models.EndpointCertificateListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -171,12 +171,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -184,13 +184,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -203,7 +203,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates" + } @distributed_trace def get( @@ -235,10 +237,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.EndpointCertificate] + ) + cls: ClsType[_models.EndpointCertificate] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -251,9 +253,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -270,4 +272,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates/{endpointType}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates/{endpointType}" + } 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 115bc3d7b55f..8d8555a8ec03 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 @@ -46,9 +46,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,10 +80,10 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +99,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,11 +116,11 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +136,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -190,10 +190,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedDatabaseBlobAuditingPolicyListResult] + ) + cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -217,12 +217,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -230,13 +230,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -249,7 +249,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings" + } @distributed_trace def get( @@ -283,11 +285,11 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] + ) + cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -301,9 +303,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -320,7 +322,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } @overload def create_or_update( @@ -433,12 +437,12 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] + ) + 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 @@ -463,9 +467,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -482,8 +486,10 @@ def create_or_update( deserialized = self._deserialize("ExtendedDatabaseBlobAuditingPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } 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 60a4c18bd86a..88acc4982b42 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 @@ -48,9 +48,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -79,10 +79,10 @@ 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 {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -114,11 +114,11 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,7 +133,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -185,10 +185,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedServerBlobAuditingPolicyListResult] + ) + cls: ClsType[_models.ExtendedServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -211,12 +211,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -224,13 +224,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -243,7 +243,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings" + } @distributed_trace def get( @@ -275,11 +277,11 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedServerBlobAuditingPolicy] + ) + cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -292,9 +294,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -311,7 +313,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } def _create_or_update_initial( self, @@ -331,12 +335,12 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ExtendedServerBlobAuditingPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ExtendedServerBlobAuditingPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -360,9 +364,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -381,7 +385,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } @overload def begin_create_or_update( @@ -501,17 +507,17 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExtendedServerBlobAuditingPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, parameters=parameters, @@ -532,7 +538,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -544,6 +550,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}" + } 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 e7ceb0e490d0..901eade427a9 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 @@ -48,9 +48,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,10 +82,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +100,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -118,9 +118,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +133,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -147,10 +147,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -165,7 +165,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -184,9 +184,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +200,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -217,9 +217,9 @@ def build_failover_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -234,7 +234,7 @@ def build_failover_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -251,9 +251,9 @@ def build_force_failover_allow_data_loss_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -268,7 +268,7 @@ def build_force_failover_allow_data_loss_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -327,10 +327,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] + ) + cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -343,9 +343,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -362,7 +362,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } def _create_or_update_initial( self, @@ -383,11 +385,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FailoverGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -411,9 +413,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -435,7 +437,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } @overload def begin_create_or_update( @@ -555,16 +559,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, failover_group_name=failover_group_name, @@ -585,7 +589,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -597,9 +601,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any @@ -615,10 +621,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -631,9 +637,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -646,7 +652,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } @distributed_trace def begin_delete( @@ -676,13 +684,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -701,7 +709,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -713,9 +721,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } def _update_initial( self, @@ -736,11 +746,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FailoverGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -764,9 +774,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -785,7 +795,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } @overload def begin_update( @@ -905,16 +917,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, server_name=server_name, failover_group_name=failover_group_name, @@ -935,7 +947,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -947,9 +959,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + } @distributed_trace def list_by_server( @@ -970,10 +984,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroupListResult] + ) + cls: ClsType[_models.FailoverGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -996,12 +1010,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1009,13 +1023,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1028,7 +1042,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups" + } def _failover_initial( self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any @@ -1044,10 +1060,10 @@ def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FailoverGroup]] + ) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -1060,9 +1076,9 @@ def _failover_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1081,7 +1097,9 @@ def _failover_initial( return deserialized - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover" + } @distributed_trace def begin_failover( @@ -1112,15 +1130,15 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._failover_initial( # type: ignore + raw_result = self._failover_initial( resource_group_name=resource_group_name, server_name=server_name, failover_group_name=failover_group_name, @@ -1139,7 +1157,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1151,9 +1169,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover" + } def _force_failover_allow_data_loss_initial( self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any @@ -1169,10 +1189,10 @@ def _force_failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FailoverGroup]] + ) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) request = build_force_failover_allow_data_loss_request( resource_group_name=resource_group_name, @@ -1185,9 +1205,9 @@ def _force_failover_allow_data_loss_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1206,7 +1226,9 @@ def _force_failover_allow_data_loss_initial( return deserialized - _force_failover_allow_data_loss_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss"} # type: ignore + _force_failover_allow_data_loss_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + } @distributed_trace def begin_force_failover_allow_data_loss( @@ -1238,15 +1260,15 @@ def begin_force_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._force_failover_allow_data_loss_initial( # type: ignore + 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, @@ -1265,7 +1287,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1277,6 +1299,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_force_failover_allow_data_loss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss"} # type: ignore + begin_force_failover_allow_data_loss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + } 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 d0fa6f5a062d..81e938a70ff0 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 @@ -46,9 +46,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,10 +80,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,9 +116,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -131,7 +131,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -145,9 +145,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -161,7 +161,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -178,10 +178,10 @@ def build_replace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -195,7 +195,7 @@ def build_replace_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -256,10 +256,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FirewallRule] + ) + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -272,9 +272,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -291,7 +291,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}" + } @overload def create_or_update( @@ -395,11 +397,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FirewallRule] + ) + 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 @@ -423,9 +425,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -442,11 +444,13 @@ def create_or_update( deserialized = self._deserialize("FirewallRule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -477,10 +481,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -493,9 +497,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -508,7 +512,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}" + } @distributed_trace def list_by_server( @@ -529,10 +535,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.FirewallRuleListResult] + ) + cls: ClsType[_models.FirewallRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -555,12 +561,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -568,13 +574,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -587,7 +593,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules" + } @overload def replace( @@ -677,11 +685,11 @@ def replace( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.FirewallRule]] + ) + 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 @@ -704,9 +712,9 @@ def replace( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -725,4 +733,6 @@ def replace( return deserialized - replace.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules"} # type: ignore + replace.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules" + } 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 cc708fc2d520..19b94ce7c395 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 @@ -51,8 +51,8 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_create_or_update_request( "geoBackupPolicyName": _SERIALIZER.url("geo_backup_policy_name", geo_backup_policy_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -92,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 = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +108,7 @@ def build_get_request( "geoBackupPolicyName": _SERIALIZER.url("geo_backup_policy_name", geo_backup_policy_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -125,7 +125,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 = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +140,7 @@ def build_list_by_database_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -283,9 +283,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GeoBackupPolicy] + api_version: Literal["2014-04-01"] = 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.GeoBackupPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -310,9 +310,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -329,11 +329,13 @@ def create_or_update( deserialized = self._deserialize("GeoBackupPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}" + } @distributed_trace def get( @@ -371,8 +373,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GeoBackupPolicy] + api_version: Literal["2014-04-01"] = 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, @@ -386,9 +388,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -405,7 +407,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}" + } @distributed_trace def list_by_database( @@ -428,8 +432,8 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GeoBackupPolicyListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.GeoBackupPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -453,12 +457,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -466,13 +470,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -485,4 +489,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies" + } 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 26df1a901dea..0fb956b47ca2 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 @@ -48,9 +48,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,10 +82,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +100,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -118,9 +118,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +133,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -147,9 +147,9 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +163,7 @@ def build_list_by_location_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -180,9 +180,9 @@ def build_failover_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -197,7 +197,7 @@ def build_failover_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -214,9 +214,9 @@ def build_force_failover_allow_data_loss_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -231,7 +231,7 @@ def build_force_failover_allow_data_loss_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -290,10 +290,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroup] + ) + cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -306,9 +306,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -325,7 +325,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } def _create_or_update_initial( self, @@ -346,11 +348,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstanceFailoverGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -374,9 +376,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -398,7 +400,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } @overload def begin_create_or_update( @@ -518,16 +522,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, location_name=location_name, failover_group_name=failover_group_name, @@ -548,7 +552,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -560,9 +564,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any @@ -578,10 +584,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -594,9 +600,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -609,7 +615,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } @distributed_trace def begin_delete( @@ -639,13 +647,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -664,7 +672,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -676,9 +684,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + } @distributed_trace def list_by_location( @@ -700,10 +710,10 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroupListResult] + ) + cls: ClsType[_models.InstanceFailoverGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -726,12 +736,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -739,13 +749,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -758,7 +768,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups" + } def _failover_initial( self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any @@ -774,10 +786,10 @@ def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstanceFailoverGroup]] + ) + cls: ClsType[Optional[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -790,9 +802,9 @@ def _failover_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -811,7 +823,9 @@ def _failover_initial( return deserialized - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover" + } @distributed_trace def begin_failover( @@ -842,15 +856,15 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._failover_initial( # type: ignore + raw_result = self._failover_initial( resource_group_name=resource_group_name, location_name=location_name, failover_group_name=failover_group_name, @@ -869,7 +883,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -881,9 +895,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover" + } def _force_failover_allow_data_loss_initial( self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any @@ -899,10 +915,10 @@ def _force_failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstanceFailoverGroup]] + ) + cls: ClsType[Optional[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) request = build_force_failover_allow_data_loss_request( resource_group_name=resource_group_name, @@ -915,9 +931,9 @@ def _force_failover_allow_data_loss_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -936,7 +952,9 @@ def _force_failover_allow_data_loss_initial( return deserialized - _force_failover_allow_data_loss_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss"} # type: ignore + _force_failover_allow_data_loss_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + } @distributed_trace def begin_force_failover_allow_data_loss( @@ -968,15 +986,15 @@ def begin_force_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstanceFailoverGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._force_failover_allow_data_loss_initial( # type: ignore + 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, @@ -995,7 +1013,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1007,6 +1025,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_force_failover_allow_data_loss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss"} # type: ignore + begin_force_failover_allow_data_loss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + } 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 17ad2e19db3d..c4c056da58cf 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 @@ -48,9 +48,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,10 +81,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,9 +116,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -130,7 +130,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -144,10 +144,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -161,7 +161,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -178,9 +178,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +193,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -208,9 +208,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -219,7 +219,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -274,10 +274,10 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePool] + ) + cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -289,9 +289,9 @@ def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -308,7 +308,9 @@ def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } def _create_or_update_initial( self, @@ -328,11 +330,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstancePool]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.InstancePool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -355,9 +357,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -379,7 +381,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } @overload def begin_create_or_update( @@ -490,16 +494,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePool] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, instance_pool_name=instance_pool_name, parameters=parameters, @@ -519,7 +523,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -531,9 +535,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, instance_pool_name: str, **kwargs: Any @@ -549,10 +555,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -564,9 +570,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -579,7 +585,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) -> LROPoller[None]: @@ -605,13 +613,13 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -629,7 +637,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -641,9 +649,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } def _update_initial( self, @@ -663,11 +673,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.InstancePool]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.InstancePool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -690,9 +700,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -711,7 +721,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } @overload def begin_update( @@ -822,16 +834,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePool] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, instance_pool_name=instance_pool_name, parameters=parameters, @@ -851,7 +863,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -863,9 +875,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + } @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.InstancePool"]: @@ -882,10 +896,10 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePoolListResult] + ) + cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -907,12 +921,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -920,13 +934,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -939,7 +953,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools" + } @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.InstancePool"]: @@ -953,10 +969,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.InstancePool"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InstancePoolListResult] + ) + cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -977,12 +993,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -990,13 +1006,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1009,4 +1025,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/instancePools"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/instancePools"} 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 845be0602373..bb63c2e917b7 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 @@ -46,9 +46,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -79,9 +79,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -113,10 +113,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +131,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -149,9 +149,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -164,7 +164,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -210,10 +210,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IPv6FirewallRuleListResult] + ) + cls: ClsType[_models.IPv6FirewallRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -236,12 +236,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -249,13 +249,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -268,7 +268,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules" + } @distributed_trace def get( @@ -299,10 +301,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IPv6FirewallRule] + ) + cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -315,9 +317,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -334,7 +336,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}" + } @overload def create_or_update( @@ -440,11 +444,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IPv6FirewallRule] + ) + 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 @@ -468,9 +472,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -487,11 +491,13 @@ def create_or_update( deserialized = self._deserialize("IPv6FirewallRule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -522,10 +528,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -538,9 +544,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -553,4 +559,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}" + } 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 2fe4e3514679..17327a6b7565 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 @@ -48,9 +48,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,9 +81,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -115,10 +115,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,7 +133,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,9 +151,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -166,7 +166,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -180,10 +180,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +198,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -247,10 +247,10 @@ def list_by_server(self, resource_group_name: str, server_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobAgentListResult] + ) + cls: ClsType[_models.JobAgentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -273,12 +273,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -286,13 +286,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -305,7 +305,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents" + } @distributed_trace def get(self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any) -> _models.JobAgent: @@ -334,10 +336,10 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobAgent] + ) + cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -350,9 +352,9 @@ def get(self, resource_group_name: str, server_name: str, job_agent_name: str, * params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -369,7 +371,9 @@ def get(self, resource_group_name: str, server_name: str, job_agent_name: str, * return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } def _create_or_update_initial( self, @@ -390,11 +394,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobAgent]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.JobAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -418,9 +422,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -442,7 +446,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } @overload def begin_create_or_update( @@ -559,16 +565,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobAgent] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, @@ -589,7 +595,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -601,9 +607,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any @@ -619,10 +627,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -635,9 +643,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -650,7 +658,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } @distributed_trace def begin_delete( @@ -680,13 +690,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -705,7 +715,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -717,9 +727,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } def _update_initial( self, @@ -740,11 +752,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobAgent]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.JobAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -768,9 +780,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -789,7 +801,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } @overload def begin_update( @@ -905,16 +919,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobAgent] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, @@ -935,7 +949,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -947,6 +961,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + } 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 5c02d06e3d86..0812108c5519 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 @@ -46,9 +46,9 @@ def build_list_by_agent_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_agent_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,9 +85,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +103,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -125,10 +125,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -144,7 +144,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -167,9 +167,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +183,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -231,10 +231,10 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobCredentialListResult] + ) + cls: ClsType[_models.JobCredentialListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -258,12 +258,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -271,13 +271,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -290,7 +290,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_agent.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials"} # type: ignore + list_by_agent.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials" + } @distributed_trace def get( @@ -323,10 +325,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobCredential] + ) + cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -340,9 +342,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -359,7 +361,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}" + } @overload def create_or_update( @@ -472,11 +476,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobCredential] + ) + 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 @@ -501,9 +505,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -520,11 +524,13 @@ def create_or_update( deserialized = self._deserialize("JobCredential", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -557,10 +563,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -574,9 +580,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -589,4 +595,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}" + } 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 2a7cd7c199ab..b6923b4a7b1d 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 @@ -61,9 +61,9 @@ def build_list_by_agent_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +78,7 @@ def build_list_by_agent_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if create_time_min is not None: @@ -114,9 +114,9 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -131,7 +131,7 @@ def build_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -145,9 +145,9 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +163,7 @@ def build_create_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -193,9 +193,9 @@ def build_list_by_job_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -211,7 +211,7 @@ def build_list_by_job_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if create_time_min is not None: @@ -248,9 +248,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -267,7 +267,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -290,9 +290,9 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -309,7 +309,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -390,10 +390,10 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -424,12 +424,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -437,13 +437,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -456,7 +456,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_agent.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/executions"} # type: ignore + list_by_agent.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/executions" + } @distributed_trace def cancel( # pylint: disable=inconsistent-return-statements @@ -497,10 +499,10 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -515,9 +517,9 @@ def cancel( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -530,7 +532,9 @@ def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/cancel" + } def _create_initial( self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any @@ -546,10 +550,10 @@ def _create_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobExecution]] + ) + cls: ClsType[Optional[_models.JobExecution]] = kwargs.pop("cls", None) request = build_create_request( resource_group_name=resource_group_name, @@ -563,9 +567,9 @@ def _create_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -584,7 +588,9 @@ def _create_initial( return deserialized - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start" + } @distributed_trace def begin_create( @@ -617,15 +623,15 @@ def begin_create( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_initial( # type: ignore + raw_result = self._create_initial( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, @@ -645,7 +651,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -657,9 +663,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start" + } @distributed_trace def list_by_job( @@ -715,10 +723,10 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -750,12 +758,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -763,13 +771,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -782,7 +790,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_job.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions"} # type: ignore + list_by_job.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions" + } @distributed_trace def get( @@ -823,10 +833,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] + ) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -841,9 +851,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -860,7 +870,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}" + } def _create_or_update_initial( self, @@ -882,10 +894,10 @@ def _create_or_update_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.JobExecution]] + ) + cls: ClsType[Optional[_models.JobExecution]] = kwargs.pop("cls", None) request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -900,9 +912,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -924,7 +936,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}" + } @distributed_trace def begin_create_or_update( @@ -965,15 +979,15 @@ def begin_create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, @@ -994,7 +1008,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1006,6 +1020,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}" + } 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 c950eb7d9ca1..3c53d244225c 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 @@ -61,9 +61,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +80,7 @@ def build_list_by_job_execution_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if create_time_min is not None: @@ -118,9 +118,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -138,7 +138,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -225,10 +225,10 @@ def list_by_job_execution( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -261,12 +261,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -274,13 +274,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -293,7 +293,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_job_execution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps"} # type: ignore + list_by_job_execution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps" + } @distributed_trace def get( @@ -337,10 +339,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] + ) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -356,9 +358,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -375,4 +377,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}" + } 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 e96d1f3f67c5..b8a40b11ea9c 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 @@ -52,9 +52,9 @@ def build_list_by_version_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_list_by_version_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -95,9 +95,9 @@ def build_get_by_version_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,7 +115,7 @@ def build_get_by_version_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -132,9 +132,9 @@ def build_list_by_job_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +150,7 @@ def build_list_by_job_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -173,9 +173,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +192,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -215,10 +215,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -235,7 +235,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -259,9 +259,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -276,7 +276,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -334,10 +334,10 @@ def list_by_version( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStepListResult] + ) + cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -363,12 +363,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -376,13 +376,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -395,7 +395,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_version.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps"} # type: ignore + list_by_version.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps" + } @distributed_trace def get_by_version( @@ -439,10 +441,10 @@ def get_by_version( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStep] + ) + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) request = build_get_by_version_request( resource_group_name=resource_group_name, @@ -458,9 +460,9 @@ def get_by_version( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -477,7 +479,9 @@ def get_by_version( return deserialized - get_by_version.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps/{stepName}"} # type: ignore + get_by_version.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps/{stepName}" + } @distributed_trace def list_by_job( @@ -502,10 +506,10 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStepListResult] + ) + cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -530,12 +534,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -543,13 +547,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -562,7 +566,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_job.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps"} # type: ignore + list_by_job.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps" + } @distributed_trace def get( @@ -603,10 +609,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStep] + ) + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -621,9 +627,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -640,7 +646,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}" + } @overload def create_or_update( @@ -762,11 +770,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobStep] + ) + 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 @@ -792,9 +800,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -811,11 +819,13 @@ def create_or_update( deserialized = self._deserialize("JobStep", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -856,10 +866,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -874,9 +884,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -889,4 +899,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}" + } 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 4aa085fe783d..6677dbb8de6c 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 @@ -61,9 +61,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +80,7 @@ def build_list_by_job_execution_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if create_time_min is not None: @@ -126,9 +126,9 @@ def build_list_by_step_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_list_by_step_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if create_time_min is not None: @@ -185,9 +185,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +206,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -293,10 +293,10 @@ def list_by_job_execution( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -329,12 +329,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -342,13 +342,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -361,7 +361,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_job_execution.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets"} # type: ignore + list_by_job_execution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets" + } @distributed_trace def list_by_step( @@ -423,10 +425,10 @@ def list_by_step( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecutionListResult] + ) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -460,12 +462,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -473,13 +475,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -492,7 +494,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_step.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets"} # type: ignore + list_by_step.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets" + } @distributed_trace def get( @@ -539,10 +543,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobExecution] + ) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -559,9 +563,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -578,4 +582,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets/{targetId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets/{targetId}" + } 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 2371b7ece7da..0a7fdf3aad8d 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 @@ -46,9 +46,9 @@ def build_list_by_agent_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_agent_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,9 +85,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +103,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -125,10 +125,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -144,7 +144,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -167,9 +167,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -183,7 +183,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -231,10 +231,10 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobTargetGroupListResult] + ) + cls: ClsType[_models.JobTargetGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -258,12 +258,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -271,13 +271,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -290,7 +290,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_agent.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups"} # type: ignore + list_by_agent.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups" + } @distributed_trace def get( @@ -323,10 +325,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobTargetGroup] + ) + cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -340,9 +342,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -359,7 +361,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}" + } @overload def create_or_update( @@ -472,11 +476,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobTargetGroup] + ) + 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 @@ -501,9 +505,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -520,11 +524,13 @@ def create_or_update( deserialized = self._deserialize("JobTargetGroup", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -557,10 +563,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -574,9 +580,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -589,4 +595,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}" + } 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 944bdcfd0265..6a11062a062c 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 @@ -46,9 +46,9 @@ def build_list_by_job_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_job_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -87,9 +87,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +106,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -159,10 +159,10 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobVersionListResult] + ) + cls: ClsType[_models.JobVersionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -187,12 +187,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -200,13 +200,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -219,7 +219,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_job.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions"} # type: ignore + list_by_job.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions" + } @distributed_trace def get( @@ -260,10 +262,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobVersion] + ) + cls: ClsType[_models.JobVersion] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -278,9 +280,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -297,4 +299,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}" + } 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 a2ae9d3917bf..99d03fa290f5 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 @@ -46,9 +46,9 @@ def build_list_by_agent_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_agent_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,9 +80,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -115,10 +115,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,7 +134,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -152,9 +152,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -168,7 +168,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -216,10 +216,10 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JobListResult] + ) + cls: ClsType[_models.JobListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -243,12 +243,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -256,13 +256,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -275,7 +275,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_agent.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs"} # type: ignore + list_by_agent.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs" + } @distributed_trace def get( @@ -308,10 +310,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Job] + ) + cls: ClsType[_models.Job] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -325,9 +327,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -344,7 +346,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}" + } @overload def create_or_update( @@ -456,11 +460,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Job] + ) + 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 @@ -485,9 +489,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -504,11 +508,13 @@ def create_or_update( deserialized = self._deserialize("Job", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -541,10 +547,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -558,9 +564,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -573,4 +579,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}" + } 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 5eff8424b75a..9adee65cf750 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 @@ -53,9 +53,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -93,10 +93,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +112,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -131,9 +131,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +148,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -170,9 +170,9 @@ def build_disable_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +188,7 @@ def build_disable_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -254,10 +254,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LedgerDigestUploads] + ) + cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -271,9 +271,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -290,7 +290,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + } def _create_or_update_initial( self, @@ -312,11 +314,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LedgerDigestUploads]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LedgerDigestUploads]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -341,9 +343,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -362,7 +364,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + } @overload def begin_create_or_update( @@ -493,16 +497,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LedgerDigestUploads] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -524,7 +528,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -536,9 +540,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + } @distributed_trace def list_by_database( @@ -561,10 +567,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LedgerDigestUploadsListResult] + ) + cls: ClsType[_models.LedgerDigestUploadsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -588,12 +594,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -601,13 +607,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -620,7 +626,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads" + } def _disable_initial( self, @@ -641,10 +649,10 @@ def _disable_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LedgerDigestUploads]] + ) + cls: ClsType[Optional[_models.LedgerDigestUploads]] = kwargs.pop("cls", None) request = build_disable_request( resource_group_name=resource_group_name, @@ -658,9 +666,9 @@ def _disable_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -679,7 +687,9 @@ def _disable_initial( return deserialized - _disable_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable"} # type: ignore + _disable_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable" + } @distributed_trace def begin_disable( @@ -718,15 +728,15 @@ def begin_disable( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LedgerDigestUploads] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._disable_initial( # type: ignore + raw_result = self._disable_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -746,7 +756,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -758,6 +768,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_disable.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable"} # type: ignore + begin_disable.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable" + } 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 cc3e03e4376b..407854d3d188 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 @@ -53,10 +53,10 @@ def build_copy_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +76,7 @@ def build_copy_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -100,10 +100,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,7 +123,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -147,9 +147,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +169,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -190,9 +190,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -210,7 +210,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -231,9 +231,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -252,7 +252,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -280,9 +280,9 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -295,7 +295,7 @@ def build_list_by_location_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -324,9 +324,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +342,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -371,10 +371,10 @@ 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 = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -395,7 +395,7 @@ def build_copy_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -420,10 +420,10 @@ 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 = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -444,7 +444,7 @@ def build_update_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -469,9 +469,9 @@ 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 = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -492,7 +492,7 @@ def build_get_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -514,9 +514,9 @@ def build_delete_by_resource_group_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -535,7 +535,7 @@ def build_delete_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -557,9 +557,9 @@ def build_list_by_resource_group_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -579,7 +579,7 @@ def build_list_by_resource_group_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -608,9 +608,9 @@ def build_list_by_resource_group_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -624,7 +624,7 @@ def build_list_by_resource_group_location_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -654,9 +654,9 @@ def build_list_by_resource_group_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -673,7 +673,7 @@ def build_list_by_resource_group_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -729,11 +729,11 @@ def _copy_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -758,9 +758,9 @@ def _copy_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -779,7 +779,9 @@ def _copy_initial( return deserialized - _copy_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy"} # type: ignore + _copy_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + } @overload def begin_copy( @@ -908,16 +910,16 @@ def begin_copy( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._copy_initial( # type: ignore + 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, @@ -939,7 +941,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -951,9 +953,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_copy.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy"} # type: ignore + begin_copy.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + } def _update_initial( self, @@ -975,11 +979,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1004,9 +1008,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1025,7 +1029,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + } @overload def begin_update( @@ -1154,16 +1160,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + 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, @@ -1185,7 +1191,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1197,9 +1203,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + } @distributed_trace def get( @@ -1236,10 +1244,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackup] + ) + cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -1253,9 +1261,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1272,7 +1280,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -1293,10 +1303,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( location_name=location_name, @@ -1310,9 +1320,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1325,7 +1335,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } @distributed_trace def begin_delete( @@ -1361,13 +1373,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore location_name=location_name, @@ -1387,7 +1399,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1399,9 +1411,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } @distributed_trace def list_by_database( @@ -1436,10 +1450,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1465,12 +1479,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1478,13 +1492,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1497,7 +1511,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups" + } @distributed_trace def list_by_location( @@ -1526,10 +1542,10 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1553,12 +1569,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1566,13 +1582,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1585,7 +1601,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups" + } @distributed_trace def list_by_server( @@ -1617,10 +1635,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1645,12 +1663,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1658,13 +1676,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1677,7 +1695,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups" + } def _copy_by_resource_group_initial( self, @@ -1700,11 +1720,11 @@ def _copy_by_resource_group_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1730,9 +1750,9 @@ def _copy_by_resource_group_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1751,7 +1771,9 @@ def _copy_by_resource_group_initial( return deserialized - _copy_by_resource_group_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy"} # type: ignore + _copy_by_resource_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + } @overload def begin_copy_by_resource_group( @@ -1892,16 +1914,16 @@ def begin_copy_by_resource_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._copy_by_resource_group_initial( # type: ignore + 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, @@ -1924,7 +1946,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1936,9 +1958,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_copy_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy"} # type: ignore + begin_copy_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + } def _update_by_resource_group_initial( self, @@ -1961,11 +1985,11 @@ def _update_by_resource_group_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1991,9 +2015,9 @@ def _update_by_resource_group_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2012,7 +2036,9 @@ def _update_by_resource_group_initial( return deserialized - _update_by_resource_group_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update"} # type: ignore + _update_by_resource_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + } @overload def begin_update_by_resource_group( @@ -2153,16 +2179,16 @@ def begin_update_by_resource_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_by_resource_group_initial( # type: ignore + 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, @@ -2185,7 +2211,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2197,9 +2223,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update"} # type: ignore + begin_update_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + } @distributed_trace def get_by_resource_group( @@ -2240,10 +2268,10 @@ def get_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackup] + ) + cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_by_resource_group_request( resource_group_name=resource_group_name, @@ -2258,9 +2286,9 @@ def get_by_resource_group( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2277,7 +2305,9 @@ def get_by_resource_group( return deserialized - get_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + get_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-statements self, @@ -2299,10 +2329,10 @@ def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_by_resource_group_request( resource_group_name=resource_group_name, @@ -2317,9 +2347,9 @@ def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-st params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -2332,7 +2362,9 @@ def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-st if cls: return cls(pipeline_response, None, {}) - _delete_by_resource_group_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + _delete_by_resource_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } @distributed_trace def begin_delete_by_resource_group( @@ -2372,13 +2404,13 @@ def begin_delete_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_by_resource_group_initial( # type: ignore resource_group_name=resource_group_name, @@ -2399,7 +2431,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2411,9 +2443,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}"} # type: ignore + begin_delete_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + } @distributed_trace def list_by_resource_group_database( @@ -2452,10 +2486,10 @@ def list_by_resource_group_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2482,12 +2516,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2495,13 +2529,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2514,7 +2548,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups"} # type: ignore + list_by_resource_group_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups" + } @distributed_trace def list_by_resource_group_location( @@ -2547,10 +2583,10 @@ def list_by_resource_group_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2575,12 +2611,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2588,13 +2624,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2607,7 +2643,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups"} # type: ignore + list_by_resource_group_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups" + } @distributed_trace def list_by_resource_group_server( @@ -2643,10 +2681,10 @@ def list_by_resource_group_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionBackupListResult] + ) + cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2672,12 +2710,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2685,13 +2723,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2704,4 +2742,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups"} # type: ignore + list_by_resource_group_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups" + } 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 fbad34676b1d..c0ecc987f6e1 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 @@ -53,9 +53,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -92,9 +92,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -108,7 +108,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -129,9 +129,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -175,9 +175,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +191,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -219,9 +219,9 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -234,7 +234,7 @@ def build_list_by_location_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -263,9 +263,9 @@ 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 = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -282,7 +282,7 @@ def build_get_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -304,9 +304,9 @@ def build_delete_by_resource_group_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -321,7 +321,7 @@ def build_delete_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -343,9 +343,9 @@ def build_list_by_resource_group_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -361,7 +361,7 @@ def build_list_by_resource_group_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -391,9 +391,9 @@ def build_list_by_resource_group_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -408,7 +408,7 @@ def build_list_by_resource_group_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -437,9 +437,9 @@ def build_list_by_resource_group_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -453,7 +453,7 @@ def build_list_by_resource_group_location_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -519,10 +519,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackup] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -536,9 +536,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -555,7 +555,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any @@ -571,10 +573,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( location_name=location_name, @@ -588,9 +590,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -603,7 +605,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } @distributed_trace def begin_delete( @@ -634,13 +638,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore location_name=location_name, @@ -660,7 +664,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -672,9 +676,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } @distributed_trace def list_by_database( @@ -710,10 +716,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -739,12 +745,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -752,13 +758,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -771,7 +777,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def list_by_instance( @@ -804,10 +812,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -832,12 +840,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -845,13 +853,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -864,7 +872,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def list_by_location( @@ -894,10 +904,10 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -921,12 +931,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -934,13 +944,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -953,7 +963,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def get_by_resource_group( @@ -994,10 +1006,10 @@ def get_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackup] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_by_resource_group_request( resource_group_name=resource_group_name, @@ -1012,9 +1024,9 @@ def get_by_resource_group( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1031,7 +1043,9 @@ def get_by_resource_group( return deserialized - get_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + get_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-statements self, @@ -1053,10 +1067,10 @@ def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-st _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_by_resource_group_request( resource_group_name=resource_group_name, @@ -1071,9 +1085,9 @@ def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-st params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1086,7 +1100,9 @@ def _delete_by_resource_group_initial( # pylint: disable=inconsistent-return-st if cls: return cls(pipeline_response, None, {}) - _delete_by_resource_group_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + _delete_by_resource_group_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } @distributed_trace def begin_delete_by_resource_group( @@ -1126,13 +1142,13 @@ def begin_delete_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_by_resource_group_initial( # type: ignore resource_group_name=resource_group_name, @@ -1153,7 +1169,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1165,9 +1181,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}"} # type: ignore + begin_delete_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + } @distributed_trace def list_by_resource_group_database( @@ -1207,10 +1225,10 @@ def list_by_resource_group_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1237,12 +1255,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1250,13 +1268,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1269,7 +1287,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_resource_group_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def list_by_resource_group_instance( @@ -1306,10 +1326,10 @@ def list_by_resource_group_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1335,12 +1355,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1348,13 +1368,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1367,7 +1387,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_resource_group_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups" + } @distributed_trace def list_by_resource_group_location( @@ -1401,10 +1423,10 @@ def list_by_resource_group_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1429,12 +1451,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1442,13 +1464,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1461,4 +1483,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups"} # type: ignore + list_by_resource_group_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups" + } 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 a8cbbcf72436..ea3975fc8a28 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 @@ -53,9 +53,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -93,10 +93,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +112,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -131,9 +131,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +148,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -214,10 +214,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionPolicy] + ) + cls: ClsType[_models.LongTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -231,9 +231,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -250,7 +250,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } def _create_or_update_initial( self, @@ -272,11 +274,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LongTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LongTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -301,9 +303,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -322,7 +324,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } @overload def begin_create_or_update( @@ -451,16 +455,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -482,7 +486,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -494,9 +498,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_database( @@ -520,10 +526,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LongTermRetentionPolicyListResult] + ) + cls: ClsType[_models.LongTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -547,12 +553,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -560,13 +566,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -579,4 +585,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies" + } 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 426128c33112..c7f4f95a9a13 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 @@ -51,9 +51,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["maintenanceWindowOptionsName"] = _SERIALIZER.query( @@ -138,10 +138,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceWindowOptions] + ) + cls: ClsType[_models.MaintenanceWindowOptions] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -155,9 +155,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -174,4 +174,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindowOptions/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindowOptions/current" + } 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 37b0273e928e..a65cecaf7a6a 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 @@ -51,9 +51,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["maintenanceWindowName"] = _SERIALIZER.query("maintenance_window_name", maintenance_window_name, "str") @@ -92,10 +92,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -108,7 +108,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["maintenanceWindowName"] = _SERIALIZER.query("maintenance_window_name", maintenance_window_name, "str") @@ -176,10 +176,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceWindows] + ) + cls: ClsType[_models.MaintenanceWindows] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -193,9 +193,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -212,7 +212,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current" + } @overload def create_or_update( # pylint: disable=inconsistent-return-statements @@ -324,11 +326,11 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -353,9 +355,9 @@ def create_or_update( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -368,4 +370,6 @@ def create_or_update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current" + } 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 ef741b575eda..704d04fe4b15 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 @@ -53,9 +53,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -93,10 +93,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +112,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -136,10 +136,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,7 +155,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -174,9 +174,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -191,7 +191,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -257,10 +257,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] + ) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -274,9 +274,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -293,7 +293,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } def _create_or_update_initial( self, @@ -315,11 +317,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -344,9 +346,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -365,7 +367,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @overload def begin_create_or_update( @@ -497,16 +501,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, database_name=database_name, @@ -528,7 +532,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -540,9 +544,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } def _update_initial( self, @@ -564,11 +570,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -593,9 +599,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -614,7 +620,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @overload def begin_update( @@ -746,16 +754,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, database_name=database_name, @@ -777,7 +785,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -789,9 +797,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_database( @@ -816,10 +826,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] + ) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -843,12 +853,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -856,13 +866,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -875,4 +885,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies" + } 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 824405766977..9f4b090b1583 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 @@ -46,9 +46,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,9 +85,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -127,10 +127,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +148,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -203,10 +203,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseAdvancedThreatProtectionListResult] + ) + cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -230,12 +230,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -243,13 +243,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -262,7 +262,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings" + } @distributed_trace def get( @@ -302,10 +304,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] + ) + cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -319,9 +321,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -338,7 +340,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } @overload def create_or_update( @@ -457,11 +461,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] + ) + 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 @@ -486,9 +490,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -505,8 +509,10 @@ def create_or_update( deserialized = self._deserialize("ManagedDatabaseAdvancedThreatProtection", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } 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 58b96e2feac7..f5898bf82a23 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 @@ -56,9 +56,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if schema is not None: @@ -108,9 +108,9 @@ def build_list_by_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +127,7 @@ def build_list_by_table_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -153,9 +153,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +173,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -244,10 +244,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumnListResult] + ) + cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -276,12 +276,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -289,13 +289,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -308,7 +308,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/columns"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/columns" + } @distributed_trace def list_by_table( @@ -345,10 +347,10 @@ def list_by_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumnListResult] + ) + cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -375,12 +377,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -388,13 +390,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -407,7 +409,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_table.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns"} # type: ignore + list_by_table.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns" + } @distributed_trace def get( @@ -451,10 +455,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseColumn] + ) + cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -470,9 +474,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -489,4 +493,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}" + } 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 4560c168faf5..e31f9ee79f1a 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 @@ -52,9 +52,9 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_list_by_location_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if only_latest_per_database is not None: @@ -91,9 +91,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +108,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -169,10 +169,10 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseMoveOperationListResult] + ) + cls: ClsType[_models.ManagedDatabaseMoveOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -197,12 +197,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -210,13 +210,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -229,7 +229,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults" + } @distributed_trace def get( @@ -260,10 +262,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseMoveOperationResult] + ) + cls: ClsType[_models.ManagedDatabaseMoveOperationResult] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -276,9 +278,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -295,4 +297,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults/{operationId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults/{operationId}" + } 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 90bf6e466f23..be22382879f0 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 @@ -51,9 +51,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -95,9 +95,9 @@ def build_list_by_query_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +113,7 @@ def build_list_by_query_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if start_time is not None: @@ -180,10 +180,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceQuery] + ) + cls: ClsType[_models.ManagedInstanceQuery] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -197,9 +197,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -216,7 +216,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}" + } @distributed_trace def list_by_query( @@ -256,10 +258,10 @@ def list_by_query( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceQueryStatistics] + ) + cls: ClsType[_models.ManagedInstanceQueryStatistics] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -287,12 +289,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -300,13 +302,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -319,4 +321,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_query.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}/statistics"} # type: ignore + list_by_query.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}/statistics" + } 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 40d0b63ece51..5a5d458c534a 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 @@ -45,10 +45,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -61,7 +61,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -193,11 +193,11 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -221,9 +221,9 @@ def update( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -236,4 +236,6 @@ def update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels" + } 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 db08eae7e4aa..ceb69a92576f 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 @@ -50,9 +50,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -134,10 +134,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseRestoreDetailsResult] + ) + cls: ClsType[_models.ManagedDatabaseRestoreDetailsResult] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -151,9 +151,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -170,4 +170,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/restoreDetails/{restoreDetailsName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/restoreDetails/{restoreDetailsName}" + } 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 ea7b606f173f..65cd88993400 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 @@ -52,9 +52,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -93,9 +93,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +111,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -170,10 +170,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSchemaListResult] + ) + cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -198,12 +198,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -211,13 +211,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -230,7 +230,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas" + } @distributed_trace def get( @@ -263,10 +265,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSchema] + ) + cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -280,9 +282,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -299,4 +301,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}" + } 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 1aaedfd00547..66c277929817 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 @@ -51,9 +51,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -91,10 +91,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +110,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -129,9 +129,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -213,10 +213,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] + ) + cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -230,9 +230,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -249,7 +249,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + } @overload def create_or_update( @@ -365,11 +367,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] + ) + 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 @@ -394,9 +396,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -413,11 +415,13 @@ def create_or_update( deserialized = self._deserialize("ManagedDatabaseSecurityAlertPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + } @distributed_trace def list_by_database( @@ -442,10 +446,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] + ) + cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -469,12 +473,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -482,13 +486,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -501,4 +505,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies" + } 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 aff249dd0659..df8a7c8df992 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 @@ -55,9 +55,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +72,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -150,10 +150,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityEventCollection] + ) + cls: ClsType[_models.SecurityEventCollection] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -181,12 +181,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -194,13 +194,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -213,4 +213,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityEvents"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityEvents" + } 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 390051b2d5fb..4846ca233d5b 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 @@ -54,9 +54,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +75,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -99,11 +99,11 @@ 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 = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -122,7 +122,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -147,10 +147,10 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -167,7 +167,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -187,10 +187,10 @@ def build_disable_recommendation_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -207,7 +207,7 @@ def build_disable_recommendation_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -227,10 +227,10 @@ def build_enable_recommendation_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -247,7 +247,7 @@ def build_enable_recommendation_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -269,9 +269,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -286,7 +286,7 @@ def build_list_current_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if skip_token is not None: @@ -309,10 +309,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -325,7 +325,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -351,9 +351,9 @@ def build_list_recommended_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -368,7 +368,7 @@ def build_list_recommended_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if skip_token is not None: @@ -452,10 +452,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabel] + ) + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -472,9 +472,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -491,7 +491,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @overload def create_or_update( @@ -631,12 +633,12 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabel] + ) + 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 @@ -664,9 +666,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -683,11 +685,13 @@ def create_or_update( deserialized = self._deserialize("SensitivityLabel", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -734,11 +738,11 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -755,9 +759,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -770,7 +774,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @distributed_trace def disable_recommendation( # pylint: disable=inconsistent-return-statements @@ -817,11 +823,11 @@ def disable_recommendation( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_disable_recommendation_request( resource_group_name=resource_group_name, @@ -838,9 +844,9 @@ def disable_recommendation( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -853,7 +859,9 @@ def disable_recommendation( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - disable_recommendation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable"} # type: ignore + disable_recommendation.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable" + } @distributed_trace def enable_recommendation( # pylint: disable=inconsistent-return-statements @@ -901,11 +909,11 @@ def enable_recommendation( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_enable_recommendation_request( resource_group_name=resource_group_name, @@ -922,9 +930,9 @@ def enable_recommendation( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -937,7 +945,9 @@ def enable_recommendation( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - enable_recommendation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable"} # type: ignore + enable_recommendation.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable" + } @distributed_trace def list_current_by_database( @@ -974,10 +984,10 @@ def list_current_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabelListResult] + ) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1004,12 +1014,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1017,13 +1027,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1036,7 +1046,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_current_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels"} # type: ignore + list_current_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels" + } @overload def update( # pylint: disable=inconsistent-return-statements @@ -1139,11 +1151,11 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -1167,9 +1179,9 @@ def update( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1182,7 +1194,9 @@ def update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels" + } @distributed_trace def list_recommended_by_database( @@ -1220,10 +1234,10 @@ def list_recommended_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabelListResult] + ) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1250,12 +1264,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1263,13 +1277,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1282,4 +1296,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_recommended_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels"} # type: ignore + list_recommended_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels" + } 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 8ca8c08af199..a253dddd73d3 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 @@ -53,9 +53,9 @@ def build_list_by_schema_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_list_by_schema_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -96,9 +96,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,7 +115,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -177,10 +177,10 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseTableListResult] + ) + cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -206,12 +206,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -219,13 +219,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -238,7 +238,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_schema.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables"} # type: ignore + list_by_schema.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables" + } @distributed_trace def get( @@ -279,10 +281,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseTable] + ) + cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -297,9 +299,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -316,4 +318,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}" + } 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 7ec83eca14dd..e4b1479adbb5 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 @@ -51,9 +51,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -91,10 +91,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +110,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -129,9 +129,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -213,10 +213,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedTransparentDataEncryption] + ) + cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -230,9 +230,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -249,7 +249,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + } @overload def create_or_update( @@ -365,11 +367,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedTransparentDataEncryption] + ) + 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 @@ -394,9 +396,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -413,11 +415,13 @@ def create_or_update( deserialized = self._deserialize("ManagedTransparentDataEncryption", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + } @distributed_trace def list_by_database( @@ -442,10 +446,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedTransparentDataEncryptionListResult] + ) + cls: ClsType[_models.ManagedTransparentDataEncryptionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -469,12 +473,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -482,13 +486,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -501,4 +505,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption" + } 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 c321248289f3..c718162405f4 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 @@ -52,9 +52,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -98,10 +98,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,7 +121,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,9 +146,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -166,7 +166,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -239,10 +239,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -258,9 +258,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -277,7 +277,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } @overload def create_or_update( @@ -420,11 +422,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] + ) + 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 @@ -451,9 +453,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -470,7 +472,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -518,10 +522,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -537,9 +541,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -552,4 +556,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + } 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 0f3faad192d4..d99087148903 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 @@ -53,9 +53,9 @@ def build_initiate_scan_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -72,7 +72,7 @@ def build_initiate_scan_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -92,9 +92,9 @@ def build_export_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +113,7 @@ def build_export_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -135,9 +135,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,7 +155,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -178,9 +178,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +199,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -249,10 +249,10 @@ def _initiate_scan_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_initiate_scan_request( resource_group_name=resource_group_name, @@ -267,9 +267,9 @@ def _initiate_scan_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -282,7 +282,9 @@ def _initiate_scan_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _initiate_scan_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan"} # type: ignore + _initiate_scan_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + } @distributed_trace def begin_initiate_scan( @@ -323,13 +325,13 @@ def begin_initiate_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._initiate_scan_initial( # type: ignore resource_group_name=resource_group_name, @@ -350,7 +352,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -362,9 +364,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_initiate_scan.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan"} # type: ignore + begin_initiate_scan.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + } @distributed_trace def export( @@ -406,10 +410,10 @@ def export( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) request = build_export_request( resource_group_name=resource_group_name, @@ -424,9 +428,9 @@ def export( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -443,11 +447,13 @@ def export( deserialized = self._deserialize("DatabaseVulnerabilityAssessmentScansExport", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - export.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export"} # type: ignore + export.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export" + } @distributed_trace def list_by_database( @@ -479,10 +485,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] + ) + cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -507,12 +513,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -520,13 +526,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -539,7 +545,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + } @distributed_trace def get( @@ -581,10 +589,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VulnerabilityAssessmentScanRecord] + ) + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -599,9 +607,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -618,4 +626,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + } 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 3cc35863b750..357c619f9bc6 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 @@ -51,9 +51,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -93,10 +93,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,7 +114,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -137,9 +137,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -155,7 +155,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -169,9 +169,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -186,7 +186,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -254,10 +254,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessment] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -271,9 +271,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -290,7 +290,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload def create_or_update( @@ -408,11 +410,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessment] + ) + 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 @@ -437,9 +439,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -456,11 +458,13 @@ def create_or_update( deserialized = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -500,10 +504,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -517,9 +521,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -532,7 +536,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def list_by_database( @@ -557,10 +563,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -584,12 +590,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -597,13 +603,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -616,4 +622,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments" + } 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 16abdaab2150..960e197f6f6b 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 @@ -48,9 +48,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,9 +81,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -115,10 +115,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,7 +133,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,9 +151,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -166,7 +166,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -180,10 +180,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +198,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -217,10 +217,10 @@ def build_cancel_move_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -233,7 +233,7 @@ def build_cancel_move_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -251,10 +251,10 @@ def build_complete_move_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -267,7 +267,7 @@ def build_complete_move_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -285,10 +285,10 @@ def build_complete_restore_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -301,7 +301,7 @@ def build_complete_restore_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -319,10 +319,10 @@ def build_start_move_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -335,7 +335,7 @@ def build_start_move_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -353,9 +353,9 @@ def build_list_inaccessible_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -369,7 +369,7 @@ def build_list_inaccessible_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -418,10 +418,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseListResult] + ) + cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -444,12 +444,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -457,13 +457,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -476,7 +476,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases" + } @distributed_trace def get( @@ -507,10 +509,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabase] + ) + cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -523,9 +525,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -542,7 +544,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } def _create_or_update_initial( self, @@ -563,11 +567,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedDatabase]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedDatabase]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -591,9 +595,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -615,7 +619,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } @overload def begin_create_or_update( @@ -735,16 +741,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabase] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, database_name=database_name, @@ -765,7 +771,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -777,9 +783,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any @@ -795,10 +803,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -811,9 +819,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -826,7 +834,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } @distributed_trace def begin_delete( @@ -856,13 +866,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -881,7 +891,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -893,9 +903,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } def _update_initial( self, @@ -916,11 +928,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedDatabase]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedDatabase]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -944,9 +956,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -965,7 +977,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } @overload def begin_update( @@ -1085,16 +1099,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabase] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, database_name=database_name, @@ -1115,7 +1129,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1127,9 +1141,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + } def _cancel_move_initial( # pylint: disable=inconsistent-return-statements self, @@ -1150,11 +1166,11 @@ def _cancel_move_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -1178,9 +1194,9 @@ def _cancel_move_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1193,7 +1209,9 @@ def _cancel_move_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _cancel_move_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove"} # type: ignore + _cancel_move_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove" + } @overload def begin_cancel_move( @@ -1310,14 +1328,14 @@ def begin_cancel_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._cancel_move_initial( # type: ignore resource_group_name=resource_group_name, @@ -1338,7 +1356,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1350,9 +1368,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_cancel_move.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove"} # type: ignore + begin_cancel_move.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove" + } def _complete_move_initial( # pylint: disable=inconsistent-return-statements self, @@ -1373,11 +1393,11 @@ def _complete_move_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -1401,9 +1421,9 @@ def _complete_move_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1416,7 +1436,9 @@ def _complete_move_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _complete_move_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove"} # type: ignore + _complete_move_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove" + } @overload def begin_complete_move( @@ -1533,14 +1555,14 @@ def begin_complete_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._complete_move_initial( # type: ignore resource_group_name=resource_group_name, @@ -1561,7 +1583,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1573,9 +1595,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_complete_move.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove"} # type: ignore + begin_complete_move.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove" + } def _complete_restore_initial( # pylint: disable=inconsistent-return-statements self, @@ -1596,11 +1620,11 @@ def _complete_restore_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -1624,9 +1648,9 @@ def _complete_restore_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1639,7 +1663,9 @@ def _complete_restore_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _complete_restore_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore"} # type: ignore + _complete_restore_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore" + } @overload def begin_complete_restore( @@ -1758,14 +1784,14 @@ def begin_complete_restore( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._complete_restore_initial( # type: ignore resource_group_name=resource_group_name, @@ -1786,7 +1812,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1798,9 +1824,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_complete_restore.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore"} # type: ignore + begin_complete_restore.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore" + } def _start_move_initial( # pylint: disable=inconsistent-return-statements self, @@ -1821,11 +1849,11 @@ def _start_move_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -1849,9 +1877,9 @@ def _start_move_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1864,7 +1892,9 @@ def _start_move_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _start_move_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove"} # type: ignore + _start_move_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove" + } @overload def begin_start_move( @@ -1981,14 +2011,14 @@ def begin_start_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._start_move_initial( # type: ignore resource_group_name=resource_group_name, @@ -2009,7 +2039,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -2021,9 +2051,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_start_move.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove"} # type: ignore + begin_start_move.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove" + } @distributed_trace def list_inaccessible_by_instance( @@ -2044,10 +2076,10 @@ def list_inaccessible_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedDatabaseListResult] + ) + cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -2070,12 +2102,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -2083,13 +2115,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2102,4 +2134,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_inaccessible_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/inaccessibleManagedDatabases"} # type: ignore + list_inaccessible_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/inaccessibleManagedDatabases" + } 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 9134566f71a2..6488e4781749 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 @@ -48,9 +48,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,9 +85,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +102,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -123,10 +123,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +141,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,9 +163,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -178,7 +178,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -225,10 +225,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdministratorListResult] + ) + cls: ClsType[_models.ManagedInstanceAdministratorListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -251,12 +251,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -264,13 +264,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -283,7 +283,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators" + } @distributed_trace def get( @@ -318,10 +320,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdministrator] + ) + cls: ClsType[_models.ManagedInstanceAdministrator] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -334,9 +336,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -353,7 +355,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } def _create_or_update_initial( self, @@ -374,11 +378,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceAdministrator]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceAdministrator]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -402,9 +406,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -426,7 +430,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } @overload def begin_create_or_update( @@ -546,16 +552,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdministrator] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, administrator_name=administrator_name, @@ -576,7 +582,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -588,9 +594,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -610,10 +618,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -626,9 +634,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -641,7 +649,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } @distributed_trace def begin_delete( @@ -675,13 +685,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -700,7 +710,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -712,6 +722,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + } 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 2bf5c2f216a7..2ca18e2ba194 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 @@ -48,9 +48,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,9 +85,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +104,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -125,10 +125,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +145,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -198,10 +198,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdvancedThreatProtectionListResult] + ) + cls: ClsType[_models.ManagedInstanceAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -224,12 +224,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -237,13 +237,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -256,7 +256,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings" + } @distributed_trace def get( @@ -293,10 +295,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdvancedThreatProtection] + ) + cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -309,9 +311,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -328,7 +330,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } def _create_or_update_initial( self, @@ -349,11 +353,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceAdvancedThreatProtection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceAdvancedThreatProtection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -377,9 +381,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -398,7 +402,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } @overload def begin_create_or_update( @@ -527,16 +533,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAdvancedThreatProtection] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + 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, @@ -557,7 +563,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -569,6 +575,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } 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 ea36c10fd436..6377c05e41df 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 @@ -52,9 +52,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -90,10 +90,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +108,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -130,9 +130,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -145,7 +145,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -159,9 +159,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +175,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -239,10 +239,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] + ) + cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -255,9 +255,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -274,7 +274,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } def _create_or_update_initial( self, @@ -295,11 +297,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceAzureADOnlyAuthentication]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceAzureADOnlyAuthentication]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -323,9 +325,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -347,7 +349,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } @overload def begin_create_or_update( @@ -478,16 +482,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, authentication_name=authentication_name, @@ -508,7 +512,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -520,9 +524,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -542,10 +548,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -558,9 +564,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -573,7 +579,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } @distributed_trace def begin_delete( @@ -608,13 +616,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -633,7 +641,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -645,9 +653,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + } @distributed_trace def list_by_instance( @@ -670,10 +680,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] + ) + cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -696,12 +706,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -709,13 +719,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -728,4 +738,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications" + } 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 99dc9b670025..81d088b54e7a 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 @@ -48,9 +48,9 @@ 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 = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_managed_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,9 +85,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +102,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -123,10 +123,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +141,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -192,10 +192,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceDtcListResult] + ) + cls: ClsType[_models.ManagedInstanceDtcListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -218,12 +218,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -231,13 +231,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -250,7 +250,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc" + } @distributed_trace def get( @@ -281,10 +283,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceDtc] + ) + cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -297,9 +299,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -316,7 +318,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + } def _create_or_update_initial( self, @@ -337,11 +341,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceDtc] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -365,9 +369,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -384,7 +388,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + } @overload def begin_create_or_update( @@ -504,16 +510,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceDtc] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, dtc_name=dtc_name, @@ -534,7 +540,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -546,6 +552,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + } 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 32690627f974..d9329fcbdd50 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 @@ -51,9 +51,9 @@ def build_revalidate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -66,7 +66,7 @@ def build_revalidate_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,9 +80,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -117,9 +117,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,7 +134,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -155,10 +155,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +173,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -223,10 +223,10 @@ def _revalidate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_revalidate_request( resource_group_name=resource_group_name, @@ -239,9 +239,9 @@ def _revalidate_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -254,7 +254,9 @@ def _revalidate_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _revalidate_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate"} # type: ignore + _revalidate_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate" + } @distributed_trace def begin_revalidate( @@ -289,13 +291,13 @@ def begin_revalidate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._revalidate_initial( # type: ignore resource_group_name=resource_group_name, @@ -314,7 +316,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -326,9 +328,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_revalidate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate"} # type: ignore + begin_revalidate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate" + } @distributed_trace def list_by_instance( @@ -350,10 +354,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceEncryptionProtectorListResult] + ) + cls: ClsType[_models.ManagedInstanceEncryptionProtectorListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -376,12 +380,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -389,13 +393,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -408,7 +412,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector" + } @distributed_trace def get( @@ -444,10 +450,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceEncryptionProtector] + ) + cls: ClsType[_models.ManagedInstanceEncryptionProtector] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -460,9 +466,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -479,7 +485,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}" + } def _create_or_update_initial( self, @@ -500,11 +508,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceEncryptionProtector]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceEncryptionProtector]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -528,9 +536,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -549,7 +557,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}" + } @overload def begin_create_or_update( @@ -675,16 +685,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceEncryptionProtector] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + 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, @@ -705,7 +715,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -717,6 +727,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}" + } 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 272e02428afb..3e7349b6567f 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 @@ -53,9 +53,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -88,9 +88,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -122,10 +122,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -140,7 +140,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -158,9 +158,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -173,7 +173,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -222,10 +222,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceKeyListResult] + ) + cls: ClsType[_models.ManagedInstanceKeyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -249,12 +249,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -262,13 +262,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -281,7 +281,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys" + } @distributed_trace def get( @@ -312,10 +314,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceKey] + ) + cls: ClsType[_models.ManagedInstanceKey] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -328,9 +330,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -347,7 +349,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } def _create_or_update_initial( self, @@ -368,11 +372,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceKey]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceKey]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -396,9 +400,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -420,7 +424,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } @overload def begin_create_or_update( @@ -543,16 +549,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceKey] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, key_name=key_name, @@ -573,7 +579,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -585,9 +591,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any @@ -603,10 +611,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -619,9 +627,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -634,7 +642,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } @distributed_trace def begin_delete( @@ -664,13 +674,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -689,7 +699,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -701,6 +711,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + } 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 5c9a122ea2b0..73dc62887640 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 @@ -53,9 +53,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -93,10 +93,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +112,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -131,9 +131,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +148,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -214,10 +214,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -231,9 +231,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -250,7 +250,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } def _create_or_update_initial( self, @@ -272,11 +274,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstanceLongTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstanceLongTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -301,9 +303,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -322,7 +324,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } @overload def begin_create_or_update( @@ -454,16 +458,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, database_name=database_name, @@ -485,7 +489,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -497,9 +501,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_database( @@ -524,10 +530,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] + ) + cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -551,12 +557,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -564,13 +570,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -583,4 +589,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies" + } 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 05e88a8c3376..7785477ba17c 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 @@ -46,9 +46,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_managed_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -79,9 +79,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -112,9 +112,9 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -127,7 +127,7 @@ def build_cancel_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -174,10 +174,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceOperationListResult] + ) + cls: ClsType[_models.ManagedInstanceOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -200,12 +200,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -213,13 +213,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -232,7 +232,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations" + } @distributed_trace def get( @@ -263,10 +265,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceOperation] + ) + cls: ClsType[_models.ManagedInstanceOperation] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -279,9 +281,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -298,7 +300,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}" + } @distributed_trace def cancel( # pylint: disable=inconsistent-return-statements @@ -329,10 +333,10 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( resource_group_name=resource_group_name, @@ -345,9 +349,9 @@ def cancel( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -360,4 +364,6 @@ def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}/cancel"} # type: ignore + cancel.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}/cancel" + } 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 0819cbf6cbfa..b628ba8c0f0b 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 @@ -52,9 +52,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -92,10 +92,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +112,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -134,9 +134,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -151,7 +151,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -165,9 +165,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +181,7 @@ def build_list_by_managed_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -240,10 +240,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateEndpointConnection] + ) + cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -256,9 +256,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -275,7 +275,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } def _create_or_update_initial( self, @@ -296,11 +298,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstancePrivateEndpointConnection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstancePrivateEndpointConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -324,9 +326,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -345,7 +347,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @overload def begin_create_or_update( @@ -467,16 +471,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateEndpointConnection] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + 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, @@ -497,7 +501,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -509,9 +513,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -527,10 +533,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -543,9 +549,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -558,7 +564,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace def begin_delete( @@ -588,13 +596,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -613,7 +621,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -625,9 +633,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace def list_by_managed_instance( @@ -650,10 +660,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] + ) + cls: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -676,12 +686,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -689,13 +699,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -708,4 +718,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections" + } 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 5aee490e6fb0..34a054145113 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 @@ -46,9 +46,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_managed_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -79,9 +79,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,10 +146,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateLinkListResult] + ) + cls: ClsType[_models.ManagedInstancePrivateLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -172,12 +172,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -185,13 +185,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -204,7 +204,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources" + } @distributed_trace def get( @@ -235,10 +237,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstancePrivateLink] + ) + cls: ClsType[_models.ManagedInstancePrivateLink] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -251,9 +253,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -270,4 +272,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources/{groupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources/{groupName}" + } 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 238081edd8c6..8609b9b294dc 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,10 +47,10 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -62,7 +62,7 @@ def build_create_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -111,11 +111,11 @@ def _create_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -138,9 +138,9 @@ def _create_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -153,7 +153,9 @@ def _create_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates" + } @overload def begin_create( @@ -261,14 +263,14 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._create_initial( # type: ignore resource_group_name=resource_group_name, @@ -288,7 +290,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -300,6 +302,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates" + } 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 d69945e728f6..5d869b6d2678 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 @@ -50,9 +50,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -90,10 +90,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +110,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -132,9 +132,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -149,7 +149,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,9 +163,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +179,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -244,10 +244,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceVulnerabilityAssessment] + ) + cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -260,9 +260,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -279,7 +279,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload def create_or_update( @@ -394,11 +396,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceVulnerabilityAssessment] + ) + 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 @@ -422,9 +424,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -441,11 +443,13 @@ def create_or_update( deserialized = self._deserialize("ManagedInstanceVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -482,10 +486,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -498,9 +502,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -513,7 +517,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def list_by_instance( @@ -537,10 +543,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -563,12 +569,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -576,13 +582,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -595,4 +601,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments" + } 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 bc1f240c7024..d0ca04d404e1 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 @@ -53,9 +53,9 @@ 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 = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_by_instance_pool_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -86,9 +86,9 @@ 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 = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_list_request(subscription_id: str, *, expand: Optional[str] = None, ** "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -116,9 +116,9 @@ 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 = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +131,7 @@ def build_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -155,9 +155,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +171,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -190,10 +190,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +207,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -225,9 +225,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -239,7 +239,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -253,10 +253,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -270,7 +270,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -300,9 +300,9 @@ 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 = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -316,7 +316,7 @@ def build_list_by_managed_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if number_of_queries is not None: @@ -351,9 +351,9 @@ def build_failover_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -365,7 +365,7 @@ def build_failover_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if replica_type is not None: @@ -415,10 +415,10 @@ def list_by_instance_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceListResult] + ) + cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -442,12 +442,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -455,13 +455,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -474,7 +474,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances"} # type: ignore + list_by_instance_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances" + } @distributed_trace def list(self, expand: Optional[str] = None, **kwargs: Any) -> Iterable["_models.ManagedInstance"]: @@ -490,10 +492,10 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> Iterable["_models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceListResult] + ) + cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -515,12 +517,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -528,13 +530,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -547,7 +549,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances"} @distributed_trace def list_by_resource_group( @@ -568,10 +570,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstanceListResult] + ) + cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -594,12 +596,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -607,13 +609,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -626,7 +628,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances" + } @distributed_trace def get( @@ -657,10 +661,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstance] + ) + cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -673,9 +677,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -692,7 +696,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } def _create_or_update_initial( self, @@ -712,11 +718,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstance]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -739,9 +745,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -763,7 +769,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } @overload def begin_create_or_update( @@ -874,16 +882,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstance] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, parameters=parameters, @@ -903,7 +911,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -915,9 +923,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, **kwargs: Any @@ -933,10 +943,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -948,9 +958,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -963,7 +973,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> LROPoller[None]: @@ -989,13 +1001,13 @@ 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 = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -1013,7 +1025,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1025,9 +1037,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } def _update_initial( self, @@ -1047,11 +1061,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedInstance]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1074,9 +1088,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1095,7 +1109,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } @overload def begin_update( @@ -1206,16 +1222,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedInstance] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, parameters=parameters, @@ -1235,7 +1251,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1247,9 +1263,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + } @distributed_trace def list_by_managed_instance( @@ -1299,10 +1317,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TopQueriesListResult] + ) + cls: ClsType[_models.TopQueriesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1332,12 +1350,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1345,13 +1363,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1364,7 +1382,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/topqueries"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/topqueries" + } def _failover_initial( # pylint: disable=inconsistent-return-statements self, @@ -1384,10 +1404,10 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -1400,9 +1420,9 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1415,7 +1435,9 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover" + } @distributed_trace def begin_failover( @@ -1450,13 +1472,13 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._failover_initial( # type: ignore resource_group_name=resource_group_name, @@ -1475,7 +1497,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1487,6 +1509,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover" + } 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 e166d938bf03..2f533964e20c 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 @@ -53,9 +53,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -95,10 +95,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,7 +116,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -140,10 +140,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -161,7 +161,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -184,9 +184,9 @@ def build_list_by_restorable_dropped_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,7 +203,7 @@ def build_list_by_restorable_dropped_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -269,10 +269,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] + ) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -286,9 +286,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -305,7 +305,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } def _create_or_update_initial( self, @@ -327,11 +329,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -356,9 +358,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -377,7 +379,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } @overload def begin_create_or_update( @@ -509,16 +513,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + 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, @@ -540,7 +544,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -552,9 +556,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } def _update_initial( self, @@ -576,11 +582,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -605,9 +611,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -626,7 +632,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } @overload def begin_update( @@ -758,16 +766,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + 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, @@ -789,7 +797,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -801,9 +809,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + } @distributed_trace def list_by_restorable_dropped_database( @@ -828,10 +838,10 @@ def list_by_restorable_dropped_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] + ) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -855,12 +865,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -868,13 +878,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -887,4 +897,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_restorable_dropped_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies"} # type: ignore + list_by_restorable_dropped_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies" + } 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 3631d486efca..3ef0fd871010 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 @@ -48,9 +48,9 @@ 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 = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_managed_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,9 +81,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -115,10 +115,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,7 +133,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,9 +151,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -166,7 +166,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -180,10 +180,10 @@ def build_acquire_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +198,7 @@ def build_acquire_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -250,10 +250,10 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerDnsAliasListResult] + ) + cls: ClsType[_models.ManagedServerDnsAliasListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -276,12 +276,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -289,13 +289,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -308,7 +308,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_managed_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases"} # type: ignore + list_by_managed_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases" + } @distributed_trace def get( @@ -339,10 +341,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerDnsAlias] + ) + cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -355,9 +357,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -374,7 +376,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } def _create_or_update_initial( self, @@ -395,11 +399,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedServerDnsAlias]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -423,9 +427,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -447,7 +451,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } @overload def begin_create_or_update( @@ -566,16 +572,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerDnsAlias] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + 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, @@ -596,7 +602,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -608,9 +614,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any @@ -626,10 +634,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -642,9 +650,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -657,7 +665,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } @distributed_trace def begin_delete( @@ -687,13 +697,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -712,7 +722,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -724,9 +734,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + } def _acquire_initial( self, @@ -747,11 +759,11 @@ def _acquire_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedServerDnsAlias]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -775,9 +787,9 @@ def _acquire_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -796,7 +808,9 @@ def _acquire_initial( return deserialized - _acquire_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire"} # type: ignore + _acquire_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire" + } @overload def begin_acquire( @@ -915,16 +929,16 @@ def begin_acquire( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerDnsAlias] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._acquire_initial( # type: ignore + raw_result = self._acquire_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, dns_alias_name=dns_alias_name, @@ -945,7 +959,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -957,6 +971,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_acquire.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire"} # type: ignore + begin_acquire.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire" + } 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 57a8bf43bb3a..863e26e8d591 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 @@ -52,9 +52,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -90,10 +90,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +108,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -127,9 +127,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +143,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -206,10 +206,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerSecurityAlertPolicy] + ) + cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -222,9 +222,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -241,7 +241,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" + } def _create_or_update_initial( self, @@ -262,11 +264,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ManagedServerSecurityAlertPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ManagedServerSecurityAlertPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -290,9 +292,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -311,7 +313,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" + } @overload def begin_create_or_update( @@ -431,16 +435,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerSecurityAlertPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + 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, @@ -461,7 +465,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -473,9 +477,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" + } @distributed_trace def list_by_instance( @@ -497,10 +503,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] + ) + cls: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -523,12 +529,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -536,13 +542,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -555,4 +561,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies" + } 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 a5cef7d36bc1..a3511b5ffd34 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 @@ -44,9 +44,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,10 +92,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] + ) + cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -115,12 +115,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -128,13 +128,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("OperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -147,4 +147,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.Sql/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Sql/operations"} 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 be61f85c40ca..cd4a7409904c 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 @@ -48,9 +48,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,10 +82,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +100,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -118,9 +118,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +133,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -147,9 +147,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +163,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -222,10 +222,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundFirewallRule] + ) + cls: ClsType[_models.OutboundFirewallRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -238,9 +238,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -257,7 +257,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } def _create_or_update_initial( self, @@ -278,11 +280,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.OutboundFirewallRule]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.OutboundFirewallRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -306,9 +308,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -330,7 +332,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } @overload def begin_create_or_update( @@ -449,16 +453,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundFirewallRule] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, outbound_rule_fqdn=outbound_rule_fqdn, @@ -479,7 +483,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -491,9 +495,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any @@ -509,10 +515,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -525,9 +531,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -540,7 +546,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } @distributed_trace def begin_delete( @@ -570,13 +578,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -595,7 +603,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -607,9 +615,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + } @distributed_trace def list_by_server( @@ -631,10 +641,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundFirewallRuleListResult] + ) + cls: ClsType[_models.OutboundFirewallRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -657,12 +667,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -670,13 +680,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -689,4 +699,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules" + } 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 7e93cb667c4f..d60e1b5e37f0 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 @@ -52,9 +52,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -92,10 +92,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +112,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -134,9 +134,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -151,7 +151,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -165,9 +165,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +181,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -240,10 +240,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] + ) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -256,9 +256,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -275,7 +275,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } def _create_or_update_initial( self, @@ -296,11 +298,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.PrivateEndpointConnection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -324,9 +326,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -345,7 +347,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @overload def begin_create_or_update( @@ -464,16 +468,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + 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, @@ -494,7 +498,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -506,9 +510,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -524,10 +530,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -540,9 +546,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -555,7 +561,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace def begin_delete( @@ -585,13 +593,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -610,7 +618,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -622,9 +630,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + } @distributed_trace def list_by_server( @@ -646,10 +656,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] + ) + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -672,12 +682,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -685,13 +695,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -704,4 +714,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections" + } 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 f577f7a96de7..b790656a5a81 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 @@ -46,9 +46,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -79,9 +79,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -145,10 +145,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourceListResult] + ) + cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -171,12 +171,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -184,13 +184,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -203,7 +203,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources" + } @distributed_trace def get( @@ -234,10 +236,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResource] + ) + cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -250,9 +252,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -269,4 +271,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources/{groupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources/{groupName}" + } 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 a14b26b66fd2..f7bac7ade34a 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 @@ -45,10 +45,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -61,7 +61,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -193,11 +193,11 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -221,9 +221,9 @@ def update( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -236,4 +236,6 @@ def update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels" + } 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 6d60d1c4ce5f..36502bf676a6 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 @@ -46,7 +46,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_get_request( "databaseName": _SERIALIZER.url("database_name", database_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -78,7 +78,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 = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,8 +151,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoverableDatabase] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.RecoverableDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -165,9 +165,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -184,7 +184,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases/{databaseName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases/{databaseName}" + } @distributed_trace def list_by_server( @@ -205,8 +207,8 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoverableDatabaseListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.RecoverableDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -229,12 +231,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -242,13 +244,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -261,4 +263,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases" + } 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 e4c40e1ea255..9701e4e40925 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 @@ -46,9 +46,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -83,9 +83,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +100,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -150,10 +150,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoverableManagedDatabaseListResult] + ) + cls: ClsType[_models.RecoverableManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -176,12 +176,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -189,13 +189,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -208,7 +208,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases" + } @distributed_trace def get( @@ -239,10 +241,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RecoverableManagedDatabase] + ) + cls: ClsType[_models.RecoverableManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -255,9 +257,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -274,4 +276,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases/{recoverableDatabaseName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases/{recoverableDatabaseName}" + } 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 f3ec1aeb8a32..9fc21371db2b 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 @@ -48,9 +48,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,9 +82,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +100,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,9 +116,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -132,7 +132,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,9 +146,9 @@ def build_failover_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +164,7 @@ def build_failover_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -181,9 +181,9 @@ 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 = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +199,7 @@ def build_failover_allow_data_loss_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -216,9 +216,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -232,7 +232,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -283,10 +283,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLinkListResult] + ) + cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -310,12 +310,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -323,13 +323,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -342,7 +342,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks" + } @distributed_trace def get( @@ -375,10 +377,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLink] + ) + cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -392,9 +394,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -411,7 +413,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any @@ -427,10 +431,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -444,9 +448,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -459,7 +463,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + } @distributed_trace def begin_delete( @@ -491,13 +497,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -517,7 +523,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -529,9 +535,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + } def _failover_initial( self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any @@ -547,10 +555,10 @@ def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ReplicationLink]] + ) + cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) request = build_failover_request( resource_group_name=resource_group_name, @@ -564,9 +572,9 @@ def _failover_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -585,7 +593,9 @@ def _failover_initial( return deserialized - _failover_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover"} # type: ignore + _failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover" + } @distributed_trace def begin_failover( @@ -618,15 +628,15 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLink] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._failover_initial( # type: ignore + raw_result = self._failover_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -646,7 +656,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -658,9 +668,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover"} # type: ignore + begin_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover" + } def _failover_allow_data_loss_initial( self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any @@ -676,10 +688,10 @@ def _failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ReplicationLink]] + ) + cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) request = build_failover_allow_data_loss_request( resource_group_name=resource_group_name, @@ -693,9 +705,9 @@ def _failover_allow_data_loss_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -714,7 +726,9 @@ def _failover_allow_data_loss_initial( return deserialized - _failover_allow_data_loss_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss"} # type: ignore + _failover_allow_data_loss_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss" + } @distributed_trace def begin_failover_allow_data_loss( @@ -747,15 +761,15 @@ def begin_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLink] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._failover_allow_data_loss_initial( # type: ignore + raw_result = self._failover_allow_data_loss_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -775,7 +789,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -787,9 +801,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_failover_allow_data_loss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss"} # type: ignore + begin_failover_allow_data_loss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss" + } @distributed_trace def list_by_server( @@ -810,10 +826,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicationLinkListResult] + ) + cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -836,12 +852,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -849,13 +865,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -868,4 +884,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/replicationLinks"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/replicationLinks" + } 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 41f1acde9109..c1563f103531 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 @@ -46,9 +46,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -79,9 +79,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -148,10 +148,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDroppedDatabaseListResult] + ) + cls: ClsType[_models.RestorableDroppedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -174,12 +174,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -187,13 +187,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -206,7 +206,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases" + } @distributed_trace def get( @@ -237,10 +239,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDroppedDatabase] + ) + cls: ClsType[_models.RestorableDroppedDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -253,9 +255,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -272,4 +274,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}" + } 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 a13ffe951b09..1e1e47ac5e49 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 @@ -46,9 +46,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -83,9 +83,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +102,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -152,10 +152,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDroppedManagedDatabaseListResult] + ) + cls: ClsType[_models.RestorableDroppedManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -178,12 +178,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -191,13 +191,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -210,7 +210,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases" + } @distributed_trace def get( @@ -241,10 +243,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorableDroppedManagedDatabase] + ) + cls: ClsType[_models.RestorableDroppedManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -257,9 +259,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -276,4 +278,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}" + } 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 ca7f25fe0b32..ed3a5b1d4b5c 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 @@ -48,9 +48,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,10 +82,10 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +100,7 @@ def build_create_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,9 +124,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -142,7 +142,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,9 +163,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -179,7 +179,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -227,10 +227,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePointListResult] + ) + cls: ClsType[_models.RestorePointListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -254,12 +254,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -267,13 +267,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -286,7 +286,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints" + } def _create_initial( self, @@ -307,11 +309,11 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RestorePoint]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.RestorePoint]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -335,9 +337,9 @@ def _create_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -359,7 +361,9 @@ def _create_initial( return deserialized - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints" + } @overload def begin_create( @@ -479,16 +483,16 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_initial( # type: ignore + raw_result = self._create_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -509,7 +513,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -521,9 +525,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints" + } @distributed_trace def get( @@ -556,10 +562,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RestorePoint] + ) + cls: ClsType[_models.RestorePoint] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -573,9 +579,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -592,7 +598,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -625,10 +633,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -642,9 +650,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -657,4 +665,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}" + } 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 33471970e1cc..c2b9f50fcb9b 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 @@ -54,9 +54,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_list_current_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if skip_token is not None: @@ -94,10 +94,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -110,7 +110,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -136,9 +136,9 @@ def build_list_recommended_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +153,7 @@ def build_list_recommended_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if skip_token is not None: @@ -184,10 +184,10 @@ def build_enable_recommendation_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -204,7 +204,7 @@ def build_enable_recommendation_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -224,10 +224,10 @@ def build_disable_recommendation_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -244,7 +244,7 @@ def build_disable_recommendation_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -266,9 +266,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -287,7 +287,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -311,11 +311,11 @@ 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 = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -334,7 +334,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -359,10 +359,10 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -379,7 +379,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -441,10 +441,10 @@ def list_current_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabelListResult] + ) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -471,12 +471,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -484,13 +484,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -503,7 +503,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_current_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels"} # type: ignore + list_current_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels" + } @overload def update( # pylint: disable=inconsistent-return-statements @@ -606,11 +608,11 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -634,9 +636,9 @@ def update( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -649,7 +651,9 @@ def update( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels" + } @distributed_trace def list_recommended_by_database( @@ -687,10 +691,10 @@ def list_recommended_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabelListResult] + ) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -717,12 +721,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -730,13 +734,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -749,7 +753,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_recommended_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels"} # type: ignore + list_recommended_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels" + } @distributed_trace def enable_recommendation( # pylint: disable=inconsistent-return-statements @@ -797,11 +803,11 @@ def enable_recommendation( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_enable_recommendation_request( resource_group_name=resource_group_name, @@ -818,9 +824,9 @@ def enable_recommendation( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -833,7 +839,9 @@ def enable_recommendation( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - enable_recommendation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable"} # type: ignore + enable_recommendation.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable" + } @distributed_trace def disable_recommendation( # pylint: disable=inconsistent-return-statements @@ -880,11 +888,11 @@ def disable_recommendation( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "recommended") # type: Literal["recommended"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_disable_recommendation_request( resource_group_name=resource_group_name, @@ -901,9 +909,9 @@ def disable_recommendation( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -916,7 +924,9 @@ def disable_recommendation( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - disable_recommendation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable"} # type: ignore + disable_recommendation.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable" + } @distributed_trace def get( @@ -964,10 +974,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabel] + ) + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -984,9 +994,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1003,7 +1013,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @overload def create_or_update( @@ -1143,12 +1155,12 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SensitivityLabel] + ) + 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 @@ -1176,9 +1188,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1195,11 +1207,13 @@ def create_or_update( deserialized = self._deserialize("SensitivityLabel", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -1246,11 +1260,11 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source = kwargs.pop("sensitivity_label_source", "current") # type: Literal["current"] - api_version = kwargs.pop( + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -1267,9 +1281,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1282,4 +1296,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + } 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 959da63c3e93..78e202ed4379 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 @@ -48,9 +48,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,9 +85,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +104,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -125,10 +125,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +145,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,10 +197,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LogicalServerAdvancedThreatProtectionListResult] + ) + cls: ClsType[_models.LogicalServerAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -223,12 +223,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -236,13 +236,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -255,7 +255,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings" + } @distributed_trace def get( @@ -292,10 +294,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAdvancedThreatProtection] + ) + cls: ClsType[_models.ServerAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -308,9 +310,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -327,7 +329,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } def _create_or_update_initial( self, @@ -348,11 +352,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerAdvancedThreatProtection]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerAdvancedThreatProtection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -376,9 +380,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -397,7 +401,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } @overload def begin_create_or_update( @@ -523,16 +529,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAdvancedThreatProtection] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + 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, @@ -553,7 +559,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -565,6 +571,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + } 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 5c5c60e7e4f9..4cc0e6ab8639 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 @@ -45,9 +45,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -80,9 +80,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -114,10 +114,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +132,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -193,10 +193,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[List[_models.Advisor]] + ) + cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) request = build_list_by_server_request( resource_group_name=resource_group_name, @@ -209,9 +209,9 @@ def list_by_server( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -228,7 +228,9 @@ def list_by_server( return deserialized - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors" + } @distributed_trace def get(self, resource_group_name: str, server_name: str, advisor_name: str, **kwargs: Any) -> _models.Advisor: @@ -257,10 +259,10 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Advisor] + ) + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -273,9 +275,9 @@ def get(self, resource_group_name: str, server_name: str, advisor_name: str, **k params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -292,7 +294,9 @@ def get(self, resource_group_name: str, server_name: str, advisor_name: str, **k return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}" + } @overload def update( @@ -396,11 +400,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Advisor] + ) + 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 @@ -424,9 +428,9 @@ def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -443,4 +447,6 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}" + } 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 e6d276434bfa..9b71fa7d4cb3 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 @@ -43,9 +43,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -76,10 +76,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,7 +93,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -150,10 +150,10 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAutomaticTuning] + ) + cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -165,9 +165,9 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -184,7 +184,9 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current" + } @overload def update( @@ -279,11 +281,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAutomaticTuning] + ) + 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 @@ -306,9 +308,9 @@ def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -325,4 +327,6 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current" + } 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 b434ef68a606..845c52460a5b 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 @@ -52,9 +52,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -90,10 +90,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +108,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -130,9 +130,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -145,7 +145,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -159,9 +159,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +175,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -239,10 +239,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAzureADAdministrator] + ) + cls: ClsType[_models.ServerAzureADAdministrator] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -255,9 +255,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -274,7 +274,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } def _create_or_update_initial( self, @@ -295,11 +297,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerAzureADAdministrator]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerAzureADAdministrator]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -323,9 +325,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -347,7 +349,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } @overload def begin_create_or_update( @@ -470,16 +474,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAzureADAdministrator] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, administrator_name=administrator_name, @@ -500,7 +504,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -512,9 +516,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -534,10 +540,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -550,9 +556,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -565,7 +571,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } @distributed_trace def begin_delete( @@ -600,13 +608,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -625,7 +633,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -637,9 +645,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + } @distributed_trace def list_by_server( @@ -661,10 +671,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdministratorListResult] + ) + cls: ClsType[_models.AdministratorListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -687,12 +697,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -700,13 +710,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -719,4 +729,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators" + } 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 eb897f81f503..a704d79cb2b8 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 @@ -52,9 +52,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -90,10 +90,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +108,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -130,9 +130,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -145,7 +145,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -159,9 +159,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +175,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -239,10 +239,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAzureADOnlyAuthentication] + ) + cls: ClsType[_models.ServerAzureADOnlyAuthentication] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -255,9 +255,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -274,7 +274,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } def _create_or_update_initial( self, @@ -295,11 +297,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerAzureADOnlyAuthentication]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerAzureADOnlyAuthentication]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -323,9 +325,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -347,7 +349,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } @overload def begin_create_or_update( @@ -475,16 +479,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerAzureADOnlyAuthentication] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, authentication_name=authentication_name, @@ -505,7 +509,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -517,9 +521,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -539,10 +545,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -555,9 +561,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -570,7 +576,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } @distributed_trace def begin_delete( @@ -605,13 +613,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -630,7 +638,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -642,9 +650,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + } @distributed_trace def list_by_server( @@ -666,10 +676,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AzureADOnlyAuthListResult] + ) + cls: ClsType[_models.AzureADOnlyAuthListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -692,12 +702,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -705,13 +715,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -724,4 +734,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications" + } 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 f6cd731d4173..8b91c3c36107 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 @@ -48,9 +48,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -79,10 +79,10 @@ 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 {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -114,11 +114,11 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,7 +133,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -185,10 +185,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerBlobAuditingPolicyListResult] + ) + cls: ClsType[_models.ServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -211,12 +211,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -224,13 +224,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -243,7 +243,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings" + } @distributed_trace def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _models.ServerBlobAuditingPolicy: @@ -273,11 +275,11 @@ 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 {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerBlobAuditingPolicy] + ) + cls: ClsType[_models.ServerBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -290,9 +292,9 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -309,7 +311,9 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}" + } def _create_or_update_initial( self, @@ -329,12 +333,12 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerBlobAuditingPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerBlobAuditingPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -358,9 +362,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -379,7 +383,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}" + } @overload def begin_create_or_update( @@ -499,17 +505,17 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - blob_auditing_policy_name = kwargs.pop("blob_auditing_policy_name", "default") # type: Literal["default"] - api_version = kwargs.pop( + blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerBlobAuditingPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, parameters=parameters, @@ -530,7 +536,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -542,6 +548,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py index b6829b2785bd..72d6cbeae399 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py @@ -47,7 +47,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -60,7 +60,7 @@ def build_delete_request( "communicationLinkName": _SERIALIZER.url("communication_link_name", communication_link_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -74,7 +74,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +89,7 @@ def build_get_request( "communicationLinkName": _SERIALIZER.url("communication_link_name", communication_link_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -106,8 +106,8 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -122,7 +122,7 @@ def build_create_or_update_request( "communicationLinkName": _SERIALIZER.url("communication_link_name", communication_link_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -141,7 +141,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 = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,7 +155,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -214,8 +214,8 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -228,9 +228,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -243,7 +243,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" + } @distributed_trace def get( @@ -274,8 +276,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerCommunicationLink] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServerCommunicationLink] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -288,9 +290,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -307,7 +309,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" + } def _create_or_update_initial( self, @@ -328,9 +332,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerCommunicationLink]] + api_version: Literal["2014-04-01"] = 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[Optional[_models.ServerCommunicationLink]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -354,9 +358,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -375,7 +379,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" + } @overload def begin_create_or_update( @@ -495,14 +501,14 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerCommunicationLink] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2014-04-01"] = 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) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, communication_link_name=communication_link_name, @@ -523,7 +529,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -535,9 +541,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" + } @distributed_trace def list_by_server( @@ -559,8 +567,8 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerCommunicationLinkListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServerCommunicationLinkListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -583,12 +591,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -596,13 +604,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -615,4 +623,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks" + } 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 6cb10541128e..1bccc8a9b093 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 @@ -52,9 +52,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -90,10 +90,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +108,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -127,9 +127,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +143,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -206,10 +206,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerConnectionPolicy] + ) + cls: ClsType[_models.ServerConnectionPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -222,9 +222,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -241,7 +241,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}" + } def _create_or_update_initial( self, @@ -262,11 +264,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerConnectionPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerConnectionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -290,9 +292,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -311,7 +313,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}" + } @overload def begin_create_or_update( @@ -431,16 +435,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerConnectionPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, connection_policy_name=connection_policy_name, @@ -461,7 +465,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -473,9 +477,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}" + } @distributed_trace def list_by_server( @@ -497,10 +503,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerConnectionPolicyListResult] + ) + cls: ClsType[_models.ServerConnectionPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -523,12 +529,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -536,13 +542,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -555,4 +561,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies" + } 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 c6c1a78e86cf..0da79e9568e5 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 @@ -48,9 +48,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,9 +85,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +104,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -125,10 +125,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,7 +145,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,10 +197,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDevOpsAuditSettingsListResult] + ) + cls: ClsType[_models.ServerDevOpsAuditSettingsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -223,12 +223,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -236,13 +236,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -255,7 +255,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings" + } @distributed_trace def get( @@ -290,10 +292,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDevOpsAuditingSettings] + ) + cls: ClsType[_models.ServerDevOpsAuditingSettings] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -306,9 +308,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -325,7 +327,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" + } def _create_or_update_initial( self, @@ -346,11 +350,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerDevOpsAuditingSettings]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerDevOpsAuditingSettings]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -374,9 +378,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -395,7 +399,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" + } @overload def begin_create_or_update( @@ -515,16 +521,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDevOpsAuditingSettings] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + 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, @@ -545,9 +551,9 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -559,6 +565,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" + } 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 1f5f473f89c6..e81f85c2f275 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 @@ -48,9 +48,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,9 +82,9 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +99,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -115,9 +115,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -130,7 +130,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -144,9 +144,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -160,7 +160,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -177,10 +177,10 @@ def build_acquire_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -195,7 +195,7 @@ def build_acquire_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -256,10 +256,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDnsAlias] + ) + cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -272,9 +272,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -291,7 +291,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } def _create_or_update_initial( self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any @@ -307,10 +309,10 @@ def _create_or_update_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerDnsAlias]] + ) + cls: ClsType[Optional[_models.ServerDnsAlias]] = kwargs.pop("cls", None) request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -323,9 +325,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -347,7 +349,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } @distributed_trace def begin_create_or_update( @@ -378,15 +382,15 @@ def begin_create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDnsAlias] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, dns_alias_name=dns_alias_name, @@ -405,7 +409,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -417,9 +421,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any @@ -435,10 +441,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -451,9 +457,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -466,7 +472,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } @distributed_trace def begin_delete( @@ -496,13 +504,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -521,7 +529,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -533,9 +541,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + } @distributed_trace def list_by_server( @@ -556,10 +566,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDnsAliasListResult] + ) + cls: ClsType[_models.ServerDnsAliasListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -582,12 +592,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -595,13 +605,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -614,7 +624,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases" + } def _acquire_initial( self, @@ -635,11 +647,11 @@ def _acquire_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerDnsAlias]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -663,9 +675,9 @@ def _acquire_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -684,7 +696,9 @@ def _acquire_initial( return deserialized - _acquire_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire"} # type: ignore + _acquire_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire" + } @overload def begin_acquire( @@ -803,16 +817,16 @@ def begin_acquire( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerDnsAlias] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._acquire_initial( # type: ignore + raw_result = self._acquire_initial( resource_group_name=resource_group_name, server_name=server_name, dns_alias_name=dns_alias_name, @@ -833,7 +847,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -845,6 +859,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_acquire.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire"} # type: ignore + begin_acquire.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire" + } 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 cb4151f5e513..6857fbcd2033 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 @@ -48,9 +48,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,9 +81,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -115,10 +115,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,7 +133,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,9 +151,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -166,7 +166,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -212,10 +212,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerKeyListResult] + ) + cls: ClsType[_models.ServerKeyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -238,12 +238,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -251,13 +251,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -270,7 +270,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys" + } @distributed_trace def get(self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any) -> _models.ServerKey: @@ -299,10 +301,10 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerKey] + ) + cls: ClsType[_models.ServerKey] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -315,9 +317,9 @@ def get(self, resource_group_name: str, server_name: str, key_name: str, **kwarg params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -334,7 +336,9 @@ def get(self, resource_group_name: str, server_name: str, key_name: str, **kwarg return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } def _create_or_update_initial( self, @@ -355,11 +359,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerKey]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerKey]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -383,9 +387,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -407,7 +411,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } @overload def begin_create_or_update( @@ -533,16 +539,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerKey] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, key_name=key_name, @@ -563,7 +569,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -575,9 +581,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any @@ -593,10 +601,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -609,9 +617,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -624,7 +632,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any) -> LROPoller[None]: @@ -652,13 +662,13 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -677,7 +687,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -689,6 +699,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + } 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 ce7885e7549b..a37b645ee438 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 @@ -46,9 +46,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -111,10 +111,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerOperationListResult] + ) + cls: ClsType[_models.ServerOperationListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -137,12 +137,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -150,13 +150,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -169,4 +169,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/operations"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/operations" + } 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 9e962fef2ba5..b4a24b55dd62 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 @@ -52,9 +52,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -90,10 +90,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +108,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -127,9 +127,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +143,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -206,10 +206,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerSecurityAlertPolicy] + ) + cls: ClsType[_models.ServerSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -222,9 +222,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -241,7 +241,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" + } def _create_or_update_initial( self, @@ -262,11 +264,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerSecurityAlertPolicy]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerSecurityAlertPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -290,9 +292,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -311,7 +313,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" + } @overload def begin_create_or_update( @@ -431,16 +435,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerSecurityAlertPolicy] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + 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, @@ -461,7 +465,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -473,9 +477,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" + } @distributed_trace def list_by_server( @@ -497,10 +503,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] + ) + cls: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -523,12 +529,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -536,13 +542,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -555,4 +561,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies" + } 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 ea22b68a272a..09ceb33e2892 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 @@ -48,9 +48,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,9 +81,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -115,10 +115,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,7 +133,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,9 +151,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -166,7 +166,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -214,10 +214,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustCertificatesListResult] + ) + cls: ClsType[_models.ServerTrustCertificatesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -240,12 +240,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -253,13 +253,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -272,7 +272,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates" + } @distributed_trace def get( @@ -303,10 +305,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustCertificate] + ) + cls: ClsType[_models.ServerTrustCertificate] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -319,9 +321,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -338,7 +340,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } def _create_or_update_initial( self, @@ -359,11 +363,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerTrustCertificate]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerTrustCertificate]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -387,9 +391,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -411,7 +415,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } @overload def begin_create_or_update( @@ -531,16 +537,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustCertificate] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, certificate_name=certificate_name, @@ -561,7 +567,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -573,9 +579,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any @@ -591,10 +599,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -607,9 +615,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -622,7 +630,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } @distributed_trace def begin_delete( @@ -652,13 +662,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-11-01-preview") - ) # type: Literal["2021-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -677,7 +687,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -689,6 +699,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + } 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 12d6a6428c3d..e96cb2b83c6e 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 @@ -48,9 +48,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,10 +82,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +100,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -118,9 +118,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +133,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -147,9 +147,9 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +163,7 @@ def build_list_by_location_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -180,9 +180,9 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -196,7 +196,7 @@ def build_list_by_instance_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -255,10 +255,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustGroup] + ) + cls: ClsType[_models.ServerTrustGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -271,9 +271,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -290,7 +290,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } def _create_or_update_initial( self, @@ -311,11 +313,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ServerTrustGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ServerTrustGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -339,9 +341,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -363,7 +365,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } @overload def begin_create_or_update( @@ -483,16 +487,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + 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, @@ -513,7 +517,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -525,9 +529,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any @@ -543,10 +549,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -559,9 +565,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -574,7 +580,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } @distributed_trace def begin_delete( @@ -604,13 +612,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -629,7 +637,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -641,9 +649,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + } @distributed_trace def list_by_location( @@ -664,10 +674,10 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustGroupListResult] + ) + cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -690,12 +700,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -703,13 +713,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -722,7 +732,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups" + } @distributed_trace def list_by_instance( @@ -743,10 +755,10 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerTrustGroupListResult] + ) + cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -769,12 +781,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -782,13 +794,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -801,4 +813,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustGroups"} # type: ignore + list_by_instance.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustGroups" + } 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 fcbef799b3d3..f04a7c9a917b 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 @@ -46,7 +46,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 = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -109,8 +109,8 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerUsageListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServerUsageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -133,12 +133,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -146,13 +146,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -165,4 +165,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages" + } 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 ed2108f092a3..7c61787afbf8 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 @@ -50,9 +50,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -90,10 +90,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +110,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -132,9 +132,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -149,7 +149,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,9 +163,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +179,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -244,10 +244,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessment] + ) + cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -260,9 +260,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -279,7 +279,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload def create_or_update( @@ -394,11 +396,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessment] + ) + 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 @@ -422,9 +424,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -441,11 +443,13 @@ def create_or_update( deserialized = self._deserialize("ServerVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -482,10 +486,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -498,9 +502,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -513,7 +517,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @distributed_trace def list_by_server( @@ -535,10 +541,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.ServerVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -561,12 +567,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -574,13 +580,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -593,4 +599,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments" + } 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 2621e0a9b0aa..543e89d0baf8 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 @@ -48,9 +48,9 @@ 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 = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_resource_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -82,9 +82,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -117,10 +117,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,7 +134,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -152,9 +152,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -166,7 +166,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -180,10 +180,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -197,7 +197,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -214,9 +214,9 @@ 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 = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -225,7 +225,7 @@ def build_list_request(subscription_id: str, *, expand: Optional[str] = None, ** "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand is not None: @@ -244,10 +244,10 @@ def build_import_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -261,7 +261,7 @@ def build_import_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -278,10 +278,10 @@ 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 = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -290,7 +290,7 @@ def build_check_name_availability_request(subscription_id: str, **kwargs: Any) - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -341,10 +341,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerListResult] + ) + cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -367,12 +367,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -380,13 +380,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -399,7 +399,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers" + } @distributed_trace def get( @@ -430,10 +432,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Server] + ) + cls: ClsType[_models.Server] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -446,9 +448,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -465,7 +467,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } def _create_or_update_initial( self, resource_group_name: str, server_name: str, parameters: Union[_models.Server, IO], **kwargs: Any @@ -481,11 +485,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Server]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Server]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -508,9 +512,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -532,7 +536,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } @overload def begin_create_or_update( @@ -636,16 +642,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Server] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, parameters=parameters, @@ -665,7 +671,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -677,9 +683,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, **kwargs: Any @@ -695,10 +703,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -710,9 +718,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -725,7 +733,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, server_name: str, **kwargs: Any) -> LROPoller[None]: @@ -751,13 +761,13 @@ 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 = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -775,7 +785,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -787,9 +797,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } def _update_initial( self, resource_group_name: str, server_name: str, parameters: Union[_models.ServerUpdate, IO], **kwargs: Any @@ -805,11 +817,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.Server]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.Server]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -832,9 +844,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -853,7 +865,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } @overload def begin_update( @@ -957,16 +971,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Server] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, server_name=server_name, parameters=parameters, @@ -986,7 +1000,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -998,9 +1012,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + } @distributed_trace def list(self, expand: Optional[str] = None, **kwargs: Any) -> Iterable["_models.Server"]: @@ -1016,10 +1032,10 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> Iterable["_models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerListResult] + ) + cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1041,12 +1057,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1054,13 +1070,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1073,7 +1089,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers"} def _import_database_initial( self, @@ -1093,11 +1109,11 @@ def _import_database_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ImportExportOperationResult]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1120,9 +1136,9 @@ def _import_database_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1141,7 +1157,9 @@ def _import_database_initial( return deserialized - _import_database_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import"} # type: ignore + _import_database_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import" + } @overload def begin_import_database( @@ -1252,16 +1270,16 @@ def begin_import_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ImportExportOperationResult] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._import_database_initial( # type: ignore + raw_result = self._import_database_initial( resource_group_name=resource_group_name, server_name=server_name, parameters=parameters, @@ -1281,7 +1299,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1293,9 +1311,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_import_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import"} # type: ignore + begin_import_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import" + } @overload def check_name_availability( @@ -1359,11 +1379,11 @@ def check_name_availability( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CheckNameAvailabilityResponse] + ) + 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 @@ -1384,9 +1404,9 @@ def check_name_availability( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1403,4 +1423,6 @@ def check_name_availability( return deserialized - check_name_availability.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability"} # type: ignore + check_name_availability.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability" + } diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py index c5ed12bcf908..faa93f38ee85 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py @@ -46,7 +46,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_get_request( "serviceObjectiveName": _SERIALIZER.url("service_objective_name", service_objective_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -78,7 +78,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 = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_list_by_server_request( "serverName": _SERIALIZER.url("server_name", server_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,8 +151,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceObjective] + api_version: Literal["2014-04-01"] = 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, @@ -165,9 +165,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -184,7 +184,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives/{serviceObjectiveName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives/{serviceObjectiveName}" + } @distributed_trace def list_by_server( @@ -205,8 +207,8 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # type: Literal["2014-04-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServiceObjectiveListResult] + api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + cls: ClsType[_models.ServiceObjectiveListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -229,12 +231,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -242,13 +244,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ServiceObjectiveListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -261,4 +263,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives" + } 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 1eac16f2afc4..8cdf4ce891de 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 @@ -45,9 +45,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -78,10 +78,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -95,7 +95,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -152,10 +152,10 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlAgentConfiguration] + ) + cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -167,9 +167,9 @@ def get(self, resource_group_name: str, managed_instance_name: str, **kwargs: An params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -186,7 +186,9 @@ def get(self, resource_group_name: str, managed_instance_name: str, **kwargs: An return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current" + } @overload def create_or_update( @@ -280,11 +282,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlAgentConfiguration] + ) + 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 @@ -307,9 +309,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -326,4 +328,6 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current" + } 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 9f070a6fafa4..7856b945d228 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 @@ -50,12 +50,12 @@ def build_list_by_sql_vulnerability_assessment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +72,7 @@ def build_list_by_sql_vulnerability_assessment_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -95,12 +95,12 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,7 +118,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -180,13 +180,13 @@ def list_by_sql_vulnerability_assessment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -211,12 +211,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -226,13 +226,13 @@ def extract_data(pipeline_response): ) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -245,7 +245,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_sql_vulnerability_assessment.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines"} # type: ignore + list_by_sql_vulnerability_assessment.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines" + } @distributed_trace def get( @@ -287,13 +289,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -308,9 +310,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -327,4 +329,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + } 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 f8c0acaf6612..76f8de27296a 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 @@ -50,13 +50,13 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -232,14 +232,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + ) + 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 @@ -265,9 +265,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -284,4 +284,6 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + } 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 8dab5200f35f..cf1d4db60810 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 @@ -50,12 +50,12 @@ def build_execute_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -70,7 +70,7 @@ def build_execute_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -116,13 +116,13 @@ def _execute_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_execute_request( resource_group_name=resource_group_name, @@ -136,9 +136,9 @@ def _execute_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -151,7 +151,9 @@ def _execute_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _execute_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan"} # type: ignore + _execute_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + } @distributed_trace def begin_execute( @@ -189,16 +191,16 @@ def begin_execute( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._execute_initial( # type: ignore resource_group_name=resource_group_name, @@ -218,7 +220,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -230,6 +232,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_execute.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan"} # type: ignore + begin_execute.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + } 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 2c2c7dba1aff..9967e947e3c1 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 @@ -51,12 +51,12 @@ def build_list_by_baseline_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,7 @@ def build_list_by_baseline_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -98,12 +98,12 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -122,7 +122,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -146,13 +146,13 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +171,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -238,13 +238,13 @@ def list_by_baseline( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -270,12 +270,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -285,13 +285,13 @@ def extract_data(pipeline_response): ) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -304,7 +304,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_baseline.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules"} # type: ignore + list_by_baseline.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules" + } @distributed_trace def get( @@ -349,13 +351,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + ) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -371,9 +373,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -390,7 +392,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } @overload def create_or_update( @@ -525,14 +529,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + ) + 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 @@ -559,9 +563,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -578,4 +582,6 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } 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 a218a7fcb2bf..3a242bfea3ad 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 @@ -50,12 +50,12 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -72,7 +72,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -143,13 +143,13 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -165,9 +165,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -180,4 +180,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + } 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 f4cb7ad124c0..fd5ce731df7f 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 @@ -51,12 +51,12 @@ def build_list_by_scan_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,7 @@ def build_list_by_scan_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -98,12 +98,12 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -122,7 +122,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -189,13 +189,13 @@ def list_by_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] + ) + cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -221,12 +221,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -234,13 +234,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -253,7 +253,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_scan.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults"} # type: ignore + list_by_scan.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults" + } @distributed_trace def get( @@ -300,13 +302,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanResults] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -322,9 +324,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -341,4 +343,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}" + } 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 72dd9ae3d727..4ce4251a4d91 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 @@ -50,12 +50,12 @@ def build_list_by_sql_vulnerability_assessments_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +72,7 @@ def build_list_by_sql_vulnerability_assessments_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -95,12 +95,12 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,7 +118,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") @@ -180,13 +180,13 @@ def list_by_sql_vulnerability_assessments( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -211,12 +211,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -224,13 +224,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -243,7 +243,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_sql_vulnerability_assessments.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans"} # type: ignore + list_by_sql_vulnerability_assessments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + } @distributed_trace def get( @@ -285,13 +287,13 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - system_database_name = kwargs.pop( + system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") - ) # type: Literal["master"] - api_version = kwargs.pop( + ) + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -306,9 +308,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -325,4 +327,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + } 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 c3cc57b42f8f..63bdb22cca96 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 @@ -48,9 +48,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -65,7 +65,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -126,10 +126,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -142,9 +142,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -157,4 +157,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + } 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 4ef11ff27006..0a28e9e937c8 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 @@ -46,9 +46,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -83,9 +83,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,7 +102,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -123,10 +123,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +143,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -195,10 +195,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessmentListResult] + ) + cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -221,12 +221,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -234,13 +234,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -253,7 +253,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments" + } @distributed_trace def get( @@ -290,10 +292,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessment] + ) + cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -306,9 +308,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -325,7 +327,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + } @overload def create_or_update( @@ -431,11 +435,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-02-01-preview") - ) # type: Literal["2022-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SqlVulnerabilityAssessment] + ) + 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 @@ -459,9 +463,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -478,8 +482,10 @@ def create_or_update( deserialized = self._deserialize("SqlVulnerabilityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + } 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 8a8f4b0483c4..0c134d3208ab 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 @@ -44,9 +44,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_by_location_request(location_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,9 +73,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +89,7 @@ def build_get_request(location_name: str, usage_name: str, subscription_id: str, "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -133,10 +133,10 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> Iterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SubscriptionUsageListResult] + ) + cls: ClsType[_models.SubscriptionUsageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -158,12 +158,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -171,13 +171,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -190,7 +190,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages" + } @distributed_trace def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.SubscriptionUsage: @@ -216,10 +218,10 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SubscriptionUsage] + ) + cls: ClsType[_models.SubscriptionUsage] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -231,9 +233,9 @@ def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.Sub params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -250,4 +252,6 @@ def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.Sub return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}" + } 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 825672a47378..6f655f266f51 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 @@ -46,9 +46,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -115,10 +115,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SynapseLinkWorkspaceListResult] + ) + cls: ClsType[_models.SynapseLinkWorkspaceListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -142,12 +142,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -155,13 +155,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -174,4 +174,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/linkWorkspaces"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/linkWorkspaces" + } 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 a82ba6f1f81d..79dbbaa0cea8 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 @@ -48,9 +48,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,10 +82,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +100,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -118,9 +118,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +133,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -147,9 +147,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +163,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -180,9 +180,9 @@ def build_generate_key_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -197,7 +197,7 @@ def build_generate_key_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -214,9 +214,9 @@ def build_list_linked_databases_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -231,7 +231,7 @@ def build_list_linked_databases_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -288,10 +288,10 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgent] + ) + cls: ClsType[_models.SyncAgent] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -304,9 +304,9 @@ def get(self, resource_group_name: str, server_name: str, sync_agent_name: str, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -323,7 +323,9 @@ def get(self, resource_group_name: str, server_name: str, sync_agent_name: str, return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } def _create_or_update_initial( self, @@ -344,11 +346,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncAgent]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -372,9 +374,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -396,7 +398,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } @overload def begin_create_or_update( @@ -513,16 +517,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgent] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, sync_agent_name=sync_agent_name, @@ -543,7 +547,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -555,9 +559,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any @@ -573,10 +579,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -589,9 +595,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -604,7 +610,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } @distributed_trace def begin_delete( @@ -634,13 +642,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -659,7 +667,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -671,9 +679,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + } @distributed_trace def list_by_server( @@ -694,10 +704,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgentListResult] + ) + cls: ClsType[_models.SyncAgentListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -720,12 +730,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -733,13 +743,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -752,7 +762,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents" + } @distributed_trace def generate_key( @@ -783,10 +795,10 @@ def generate_key( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgentKeyProperties] + ) + cls: ClsType[_models.SyncAgentKeyProperties] = kwargs.pop("cls", None) request = build_generate_key_request( resource_group_name=resource_group_name, @@ -799,9 +811,9 @@ def generate_key( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -818,7 +830,9 @@ def generate_key( return deserialized - generate_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/generateKey"} # type: ignore + generate_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/generateKey" + } @distributed_trace def list_linked_databases( @@ -842,10 +856,10 @@ def list_linked_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncAgentLinkedDatabaseListResult] + ) + cls: ClsType[_models.SyncAgentLinkedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -869,12 +883,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -882,13 +896,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -901,4 +915,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_linked_databases.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/linkedDatabases"} # type: ignore + list_linked_databases.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/linkedDatabases" + } 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 89f12e838616..2cf4189d5610 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 @@ -46,9 +46,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_sync_database_ids_request(location_name: str, subscription_id: st "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,9 +82,9 @@ def build_refresh_hub_schema_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -98,7 +98,7 @@ def build_refresh_hub_schema_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -117,9 +117,9 @@ def build_list_hub_schemas_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,7 +135,7 @@ def build_list_hub_schemas_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -162,9 +162,9 @@ def build_list_logs_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +180,7 @@ def build_list_logs_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["startTime"] = _SERIALIZER.query("start_time", start_time, "str") @@ -208,9 +208,9 @@ def build_cancel_sync_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -224,7 +224,7 @@ def build_cancel_sync_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -242,9 +242,9 @@ def build_trigger_sync_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -258,7 +258,7 @@ def build_trigger_sync_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -277,9 +277,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -295,7 +295,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -317,10 +317,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -336,7 +336,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -359,9 +359,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -375,7 +375,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -394,10 +394,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -413,7 +413,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -432,9 +432,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -449,7 +449,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -494,10 +494,10 @@ def list_sync_database_ids(self, location_name: str, **kwargs: Any) -> Iterable[ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncDatabaseIdListResult] + ) + cls: ClsType[_models.SyncDatabaseIdListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -519,12 +519,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -532,13 +532,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -551,7 +551,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_sync_database_ids.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds"} # type: ignore + list_sync_database_ids.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds" + } def _refresh_hub_schema_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any @@ -567,10 +569,10 @@ def _refresh_hub_schema_initial( # pylint: disable=inconsistent-return-statemen _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_refresh_hub_schema_request( resource_group_name=resource_group_name, @@ -584,9 +586,9 @@ def _refresh_hub_schema_initial( # pylint: disable=inconsistent-return-statemen params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -599,7 +601,9 @@ def _refresh_hub_schema_initial( # pylint: disable=inconsistent-return-statemen if cls: return cls(pipeline_response, None, {}) - _refresh_hub_schema_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema"} # type: ignore + _refresh_hub_schema_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema" + } @distributed_trace def begin_refresh_hub_schema( @@ -631,13 +635,13 @@ def begin_refresh_hub_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._refresh_hub_schema_initial( # type: ignore resource_group_name=resource_group_name, @@ -657,7 +661,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -669,9 +673,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_refresh_hub_schema.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema"} # type: ignore + begin_refresh_hub_schema.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema" + } @distributed_trace def list_hub_schemas( @@ -697,10 +703,10 @@ def list_hub_schemas( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncFullSchemaPropertiesListResult] + ) + cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -725,12 +731,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -738,13 +744,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -757,7 +763,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_hub_schemas.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas"} # type: ignore + list_hub_schemas.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas" + } @distributed_trace def list_logs( @@ -802,10 +810,10 @@ def list_logs( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroupLogListResult] + ) + cls: ClsType[_models.SyncGroupLogListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -834,12 +842,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -847,13 +855,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -866,7 +874,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_logs.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs"} # type: ignore + list_logs.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs" + } @distributed_trace def cancel_sync( # pylint: disable=inconsistent-return-statements @@ -899,10 +909,10 @@ def cancel_sync( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_sync_request( resource_group_name=resource_group_name, @@ -916,9 +926,9 @@ def cancel_sync( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -931,7 +941,9 @@ def cancel_sync( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel_sync.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync"} # type: ignore + cancel_sync.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync" + } @distributed_trace def trigger_sync( # pylint: disable=inconsistent-return-statements @@ -964,10 +976,10 @@ def trigger_sync( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_trigger_sync_request( resource_group_name=resource_group_name, @@ -981,9 +993,9 @@ def trigger_sync( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -996,7 +1008,9 @@ def trigger_sync( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - trigger_sync.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync"} # type: ignore + trigger_sync.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync" + } @distributed_trace def get( @@ -1029,10 +1043,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroup] + ) + cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -1046,9 +1060,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1065,7 +1079,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } def _create_or_update_initial( self, @@ -1087,11 +1103,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1116,9 +1132,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1140,7 +1156,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } @overload def begin_create_or_update( @@ -1266,16 +1284,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1297,7 +1315,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1309,9 +1327,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any @@ -1327,10 +1347,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -1344,9 +1364,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1359,7 +1379,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } @distributed_trace def begin_delete( @@ -1391,13 +1413,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -1417,7 +1439,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1429,9 +1451,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } def _update_initial( self, @@ -1453,11 +1477,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1482,9 +1506,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1503,7 +1527,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } @overload def begin_update( @@ -1629,16 +1655,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1660,7 +1686,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1672,9 +1698,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + } @distributed_trace def list_by_database( @@ -1697,10 +1725,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncGroupListResult] + ) + cls: ClsType[_models.SyncGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1724,12 +1752,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1737,13 +1765,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1756,4 +1784,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups" + } 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 0baa4a06fb9d..dad008521cbf 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 @@ -54,9 +54,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -96,10 +96,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,7 +116,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -140,9 +140,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -157,7 +157,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -177,10 +177,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -197,7 +197,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -221,9 +221,9 @@ def build_list_by_sync_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -239,7 +239,7 @@ def build_list_by_sync_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -262,9 +262,9 @@ def build_list_member_schemas_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -281,7 +281,7 @@ def build_list_member_schemas_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -303,9 +303,9 @@ def build_refresh_member_schema_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -320,7 +320,7 @@ def build_refresh_member_schema_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -387,10 +387,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncMember] + ) + cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -405,9 +405,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -424,7 +424,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } def _create_or_update_initial( self, @@ -447,11 +449,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncMember]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncMember]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -477,9 +479,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -501,7 +503,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } @overload def begin_create_or_update( @@ -639,16 +643,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncMember] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -671,7 +675,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -683,9 +687,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -707,10 +713,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -725,9 +731,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -740,7 +746,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } @distributed_trace def begin_delete( @@ -781,13 +789,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -808,7 +816,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -820,9 +828,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } def _update_initial( self, @@ -845,11 +855,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.SyncMember]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.SyncMember]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -875,9 +885,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -896,7 +906,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } @overload def begin_update( @@ -1034,16 +1046,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncMember] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1066,7 +1078,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1078,9 +1090,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + } @distributed_trace def list_by_sync_group( @@ -1105,10 +1119,10 @@ def list_by_sync_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncMemberListResult] + ) + cls: ClsType[_models.SyncMemberListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1133,12 +1147,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1146,13 +1160,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1165,7 +1179,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_sync_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers"} # type: ignore + list_by_sync_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers" + } @distributed_trace def list_member_schemas( @@ -1200,10 +1216,10 @@ def list_member_schemas( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SyncFullSchemaPropertiesListResult] + ) + cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -1229,12 +1245,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -1242,13 +1258,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1261,7 +1277,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_member_schemas.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas"} # type: ignore + list_member_schemas.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas" + } def _refresh_member_schema_initial( # pylint: disable=inconsistent-return-statements self, @@ -1283,10 +1301,10 @@ def _refresh_member_schema_initial( # pylint: disable=inconsistent-return-state _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_refresh_member_schema_request( resource_group_name=resource_group_name, @@ -1301,9 +1319,9 @@ def _refresh_member_schema_initial( # pylint: disable=inconsistent-return-state params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1316,7 +1334,9 @@ def _refresh_member_schema_initial( # pylint: disable=inconsistent-return-state if cls: return cls(pipeline_response, None, {}) - _refresh_member_schema_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema"} # type: ignore + _refresh_member_schema_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema" + } @distributed_trace def begin_refresh_member_schema( @@ -1357,13 +1377,13 @@ def begin_refresh_member_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._refresh_member_schema_initial( # type: ignore resource_group_name=resource_group_name, @@ -1384,7 +1404,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1396,6 +1416,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_refresh_member_schema.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema"} # type: ignore + begin_refresh_member_schema.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema" + } 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 13273759e9d5..c0759bf8c622 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,10 +47,10 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( "template_url", @@ -62,7 +62,7 @@ def build_create_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,11 +107,11 @@ def _create_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + 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 @@ -134,9 +134,9 @@ def _create_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -149,7 +149,9 @@ def _create_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _create_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates"} # type: ignore + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates" + } @overload def begin_create( @@ -253,14 +255,14 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._create_initial( # type: ignore resource_group_name=resource_group_name, @@ -280,7 +282,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -292,6 +294,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates"} # type: ignore + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates" + } 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 0c1617b979fe..9696ee9e2e62 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 @@ -44,9 +44,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_by_location_request(location_name: str, subscription_id: str, **k "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,9 +73,9 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +89,7 @@ def build_get_request(location_name: str, time_zone_id: str, subscription_id: st "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -133,10 +133,10 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> Iterable["_mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TimeZoneListResult] + ) + cls: ClsType[_models.TimeZoneListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -158,12 +158,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -171,13 +171,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -190,7 +190,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones"} # type: ignore + list_by_location.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones" + } @distributed_trace def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.TimeZone: @@ -216,10 +218,10 @@ 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 = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TimeZone] + ) + cls: ClsType[_models.TimeZone] = kwargs.pop("cls", None) request = build_get_request( location_name=location_name, @@ -231,9 +233,9 @@ def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.T params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -250,4 +252,6 @@ def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.T return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId}" + } 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 7ac35659b652..fcc37ed82013 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 @@ -51,9 +51,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -91,10 +91,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +110,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -129,9 +129,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +146,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -213,10 +213,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LogicalDatabaseTransparentDataEncryption] + ) + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -230,9 +230,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -249,7 +249,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + } @overload def create_or_update( @@ -365,11 +367,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.LogicalDatabaseTransparentDataEncryption]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.LogicalDatabaseTransparentDataEncryption]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -394,9 +396,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -418,7 +420,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + } @distributed_trace def list_by_database( @@ -444,10 +448,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.LogicalDatabaseTransparentDataEncryptionListResult] + ) + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryptionListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -471,12 +475,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -484,13 +488,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -503,4 +507,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption" + } 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 6037657e10c7..4745ee01a5af 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 @@ -51,9 +51,9 @@ 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 = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +67,7 @@ def build_list_by_instance_pool_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters if expand_children is not None: @@ -121,10 +121,10 @@ def list_by_instance_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-02-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-02-01-preview") - ) # type: Literal["2021-02-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UsageListResult] + ) + cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -148,12 +148,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -161,13 +161,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -180,4 +180,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_instance_pool.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/usages"} # type: ignore + list_by_instance_pool.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/usages" + } 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 32716f62c57b..29398edd1dad 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 @@ -46,9 +46,9 @@ 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 = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,7 +57,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -72,9 +72,9 @@ 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 = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +87,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -104,9 +104,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +120,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -136,9 +136,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -150,7 +150,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,10 +164,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +181,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -200,9 +200,9 @@ def build_update_dns_servers_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +216,7 @@ def build_update_dns_servers_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -258,10 +258,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.VirtualCluster"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualClusterListResult] + ) + cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -282,12 +282,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -295,13 +295,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -314,7 +314,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters"} @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.VirtualCluster"]: @@ -331,10 +331,10 @@ 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 = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualClusterListResult] + ) + cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -356,12 +356,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -369,13 +369,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -388,7 +388,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters" + } @distributed_trace def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any) -> _models.VirtualCluster: @@ -415,10 +417,10 @@ 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 = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualCluster] + ) + cls: ClsType[_models.VirtualCluster] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -430,9 +432,9 @@ def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -449,7 +451,9 @@ def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any @@ -465,10 +469,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -480,9 +484,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -495,7 +499,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } @distributed_trace def begin_delete(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any) -> LROPoller[None]: @@ -521,13 +527,13 @@ 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 = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -545,7 +551,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -557,9 +563,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } def _update_initial( self, @@ -579,11 +587,11 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualCluster]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualCluster]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -606,9 +614,9 @@ def _update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -627,7 +635,9 @@ def _update_initial( return deserialized - _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + _update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } @overload def begin_update( @@ -738,16 +748,16 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualCluster] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( # type: ignore + raw_result = self._update_initial( resource_group_name=resource_group_name, virtual_cluster_name=virtual_cluster_name, parameters=parameters, @@ -767,7 +777,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -779,9 +789,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}"} # type: ignore + begin_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + } def _update_dns_servers_initial( self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any @@ -797,10 +809,10 @@ def _update_dns_servers_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.UpdateVirtualClusterDnsServersOperation]] + ) + cls: ClsType[Optional[_models.UpdateVirtualClusterDnsServersOperation]] = kwargs.pop("cls", None) request = build_update_dns_servers_request( resource_group_name=resource_group_name, @@ -812,9 +824,9 @@ def _update_dns_servers_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -833,7 +845,9 @@ def _update_dns_servers_initial( return deserialized - _update_dns_servers_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers"} # type: ignore + _update_dns_servers_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers" + } @distributed_trace def begin_update_dns_servers( @@ -864,15 +878,15 @@ def begin_update_dns_servers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.UpdateVirtualClusterDnsServersOperation] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_dns_servers_initial( # type: ignore + raw_result = self._update_dns_servers_initial( resource_group_name=resource_group_name, virtual_cluster_name=virtual_cluster_name, api_version=api_version, @@ -890,7 +904,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -902,6 +916,8 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_update_dns_servers.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers"} # type: ignore + begin_update_dns_servers.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers" + } 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 0e483d29dbc8..f7130dafe2bf 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 @@ -48,9 +48,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,10 +82,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +100,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -118,9 +118,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -133,7 +133,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -147,9 +147,9 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +163,7 @@ def build_list_by_server_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -222,10 +222,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualNetworkRule] + ) + cls: ClsType[_models.VirtualNetworkRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -238,9 +238,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -257,7 +257,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } def _create_or_update_initial( self, @@ -278,11 +280,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.VirtualNetworkRule]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.VirtualNetworkRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -306,9 +308,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -330,7 +332,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } @overload def begin_create_or_update( @@ -450,16 +454,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualNetworkRule] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + 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, @@ -480,7 +484,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -492,9 +496,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any @@ -510,10 +516,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -526,9 +532,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -541,7 +547,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } @distributed_trace def begin_delete( @@ -571,13 +579,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -596,7 +604,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -608,9 +616,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + } @distributed_trace def list_by_server( @@ -631,10 +641,10 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.VirtualNetworkRuleListResult] + ) + cls: ClsType[_models.VirtualNetworkRuleListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -657,12 +667,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -670,13 +680,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -689,4 +699,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_server.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules"} # type: ignore + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules" + } 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 64be5bdf1318..f864ea12572c 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 @@ -54,9 +54,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -96,10 +96,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,7 +116,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -140,9 +140,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -157,7 +157,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -176,9 +176,9 @@ def build_list_by_workload_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -194,7 +194,7 @@ def build_list_by_workload_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -264,10 +264,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadClassifier] + ) + cls: ClsType[_models.WorkloadClassifier] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -282,9 +282,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -301,7 +301,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } def _create_or_update_initial( self, @@ -324,11 +326,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.WorkloadClassifier]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.WorkloadClassifier]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -354,9 +356,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -378,7 +380,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } @overload def begin_create_or_update( @@ -522,16 +526,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadClassifier] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -554,7 +558,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -566,9 +570,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -590,10 +596,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -608,9 +614,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -623,7 +629,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } @distributed_trace def begin_delete( @@ -664,13 +672,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -691,7 +699,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -703,9 +711,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + } @distributed_trace def list_by_workload_group( @@ -731,10 +741,10 @@ def list_by_workload_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadClassifierListResult] + ) + cls: ClsType[_models.WorkloadClassifierListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -759,12 +769,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -772,13 +782,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -791,4 +801,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_workload_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers"} # type: ignore + list_by_workload_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers" + } 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 8156c89fa8c1..18a0345c0140 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 @@ -53,9 +53,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -93,10 +93,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +112,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -135,9 +135,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -151,7 +151,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -165,9 +165,9 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +182,7 @@ def build_list_by_database_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -243,10 +243,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadGroup] + ) + cls: ClsType[_models.WorkloadGroup] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -260,9 +260,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -279,7 +279,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } def _create_or_update_initial( self, @@ -301,11 +303,11 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.WorkloadGroup]] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.WorkloadGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -330,9 +332,9 @@ def _create_or_update_initial( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -354,7 +356,9 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } @overload def begin_create_or_update( @@ -483,16 +487,16 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadGroup] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( # type: ignore + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -514,7 +518,7 @@ def get_long_running_output(pipeline_response): return deserialized if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -526,9 +530,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + begin_create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any @@ -544,10 +550,10 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -561,9 +567,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -576,7 +582,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } @distributed_trace def begin_delete( @@ -608,13 +616,13 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + 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 = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -634,7 +642,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -646,9 +654,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + } @distributed_trace def list_by_database( @@ -671,10 +681,10 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-11-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-11-01-preview") - ) # type: Literal["2020-11-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadGroupListResult] + ) + cls: ClsType[_models.WorkloadGroupListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -698,12 +708,12 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: request = HttpRequest("GET", next_link) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -711,13 +721,13 @@ 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) + 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) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -730,4 +740,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_database.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups"} # type: ignore + list_by_database.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups" + } diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_an_existing_azure_active_directory_administrator..py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_create_or_update.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_an_existing_azure_active_directory_administrator..py rename to sdk/sql/azure-mgmt-sql/generated_samples/administrator_create_or_update.py index fc6bd1982b7d..75b0a5eb2b1e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_an_existing_azure_active_directory_administrator..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_create_or_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_or_updates_an_existing_azure_active_directory_administrator..py + python administrator_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_azure_active_directory_administrator..py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_azure_active_directory_administrator..py rename to sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py index 29b99edd34b8..20c07d4455c7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_azure_active_directory_administrator..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_azure_active_directory_administrator..py + python administrator_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_azure_active_directory_administrator..py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_azure_active_directory_administrator..py rename to sdk/sql/azure-mgmt-sql/generated_samples/administrator_get.py index b9bbfea6fbba..e4fd018baeee 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_azure_active_directory_administrator..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_azure_active_directory_administrator..py + python administrator_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_azure_active_directory_administrator..py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_list.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_azure_active_directory_administrator..py rename to sdk/sql/azure-mgmt-sql/generated_samples/administrator_list.py index b87648885cee..8dd3b268055b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_azure_active_directory_administrator..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_list_of_azure_active_directory_administrator..py + python administrator_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, 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 new file mode 100644 index 000000000000..514cd752b553 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_create_or_update.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) 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 azure_ad_only_auth_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.server_azure_ad_only_authentications.begin_create_or_update( + resource_group_name="sqlcrudtest-4799", + server_name="sqlcrudtest-6440", + authentication_name="Default", + parameters={"properties": {"azureADOnlyAuthentication": False}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..76a4c845ea88 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_delete.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 azure_ad_only_auth_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.server_azure_ad_only_authentications.begin_delete( + resource_group_name="sqlcrudtest-4799", + server_name="sqlcrudtest-6440", + authentication_name="Default", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..5ae544803c4e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 azure_ad_only_auth_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.server_azure_ad_only_authentications.get( + resource_group_name="sqlcrudtest-4799", + server_name="sqlcrudtest-6440", + authentication_name="Default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..a620d1ae9888 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_list.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 azure_ad_only_auth_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="00000000-1111-2222-3333-444444444444", + ) + + response = client.server_azure_ad_only_authentications.list_by_server( + resource_group_name="sqlcrudtest-4799", + server_name="sqlcrudtest-6440", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_database_management_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_database_management_operation.py rename to sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py index 85e75005eb7c..c4b92f07ce5c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_database_management_operation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python cancel_the_database_management_operation.py + python cancel_database_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_elastic_pool_management_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_elastic_pool_management_operation.py rename to sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py index 60ff1f895bcf..86d93b9c65ee 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_elastic_pool_management_operation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python cancel_the_elastic_pool_management_operation.py + python cancel_elastic_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_a_job_execution..py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/cancel_a_job_execution..py rename to sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py index 28a50b7e5cbb..26e74b0f2893 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_a_job_execution..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python cancel_a_job_execution..py + python cancel_job_execution.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_managed_instance_management_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_managed_instance_management_operation.py rename to sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py index 6c35d9de3157..54cf628ff8b4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_the_managed_instance_management_operation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python cancel_the_managed_instance_management_operation.py + python cancel_managed_instance_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_already_exists.py b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_already_exists.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_already_exists.py rename to sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_already_exists.py index b14ad17cd0af..a283e5dcb908 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_already_exists.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_already_exists.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python check_for_a_server_name_that_already_exists.py + python check_name_availability_server_already_exists.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_is_available.py b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_available.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_is_available.py rename to sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_available.py index 60e6d634c73b..60d7a5e2b27c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_is_available.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_available.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python check_for_a_server_name_that_is_available.py + python check_name_availability_server_available.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_is_invalid.py b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_invalid.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_is_invalid.py rename to sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_invalid.py index 42210c149423..437eedb54a1f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/check_for_a_server_name_that_is_invalid.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_invalid.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python check_for_a_server_name_that_is_invalid.py + python check_name_availability_server_invalid.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_the_sensitivity_label_of_a_given_column_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_create_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/updates_the_sensitivity_label_of_a_given_column_with_all_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_create_max.py index 56df132a0828..7f4740c0b4f4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_the_sensitivity_label_of_a_given_column_with_all_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python updates_the_sensitivity_label_of_a_given_column_with_all_parameters.py + python column_sensitivity_label_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_the_sensitivity_label_of_a_given_column.py b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/deletes_the_sensitivity_label_of_a_given_column.py rename to sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py index e86b4bacce2f..1e6905b0c786 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_the_sensitivity_label_of_a_given_column.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python deletes_the_sensitivity_label_of_a_given_column.py + python column_sensitivity_label_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_sensitivity_label_of_a_given_column.py b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_the_sensitivity_label_of_a_given_column.py rename to sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_get.py index d705b50d1a10..b03bde7daa70 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_sensitivity_label_of_a_given_column.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_the_sensitivity_label_of_a_given_column.py + python column_sensitivity_label_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/filter_database_columns.py b/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_max.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/filter_database_columns.py rename to sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_max.py index 0d50a2a9715f..621ef01993d5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/filter_database_columns.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python filter_database_columns.py + python columns_list_by_database_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_columns.py b/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_min.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_database_columns.py rename to sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_min.py index 685415384ef8..4c4ef960ce8a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_columns.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_database_columns.py + python columns_list_by_database_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_specified_backup_storage_redundancy..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_configured_backup_storage_redundancy.py similarity index 92% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_specified_backup_storage_redundancy..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_database_configured_backup_storage_redundancy.py index 92f7ecfd2bfb..776be65d2087 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_specified_backup_storage_redundancy..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_configured_backup_storage_redundancy.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_database_with_specified_backup_storage_redundancy..py + python create_database_configured_backup_storage_redundancy.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseConfiguredBackupStorageRedundancy.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseConfiguredBackupStorageRedundancy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_a_copy..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_copy_mode.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_a_copy..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_database_copy_mode.py index d1355fe8fd07..cf6a37a38f70 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_a_copy..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_copy_mode.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_database_as_a_copy..py + python create_database_copy_mode.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, @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseCopyMode.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/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 new file mode 100644 index 000000000000..7fe7ab0bc489 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_enclave.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) 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_enclave.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={"location": "southeastasia", "properties": {"preferredEnclaveType": "Default"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseDefaultEnclave.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_default_mode..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_default_mode..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode.py index de01fb1ca4f6..9fca87c06715 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_default_mode..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_database_with_default_mode..py + python create_database_default_mode.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, @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseDefaultMode.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseDefaultMode.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_ledger_on..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_ledger.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_ledger_on..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_database_ledger.py index 2899cb211bf9..eaae7fb5a1b3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_ledger_on..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_ledger.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_database_with_ledger_on..py + python create_database_ledger.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseLedger.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseLedger.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_preferred_maintenance_window..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_maintenance_configuration.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_preferred_maintenance_window..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_database_maintenance_configuration.py index d238b588f620..3256d82643fd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_preferred_maintenance_window..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_maintenance_configuration.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_database_with_preferred_maintenance_window..py + python create_database_maintenance_configuration.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, @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseMaintenanceConfiguration.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_minimum_number_of_parameters..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_min.py similarity index 92% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_minimum_number_of_parameters..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_database_min.py index b0c1b8915f1e..9c66a520b2a6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_with_minimum_number_of_parameters..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_database_with_minimum_number_of_parameters..py + python create_database_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, @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_named_replica_secondary..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_named_replica.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_named_replica_secondary..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_database_named_replica.py index 4a26bd681bc5..9b4f9758023c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_named_replica_secondary..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_named_replica.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_database_as_named_replica_secondary..py + python create_database_named_replica.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, @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseNamedReplica.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseNamedReplica.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_from_point_in_time_restore..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_pitr_mode.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_from_point_in_time_restore..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_database_pitr_mode.py index 0d7afae35835..88b4fc545e82 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_from_point_in_time_restore..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_pitr_mode.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_database_from_point_in_time_restore..py + python create_database_pitr_mode.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, @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabasePITRMode.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabasePITRMode.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_an_online_secondary..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_secondary_mode.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_an_online_secondary..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_database_secondary_mode.py index d6354f3c976e..42e8b1cdd70a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_an_online_secondary..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_secondary_mode.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_database_as_an_online_secondary..py + python create_database_secondary_mode.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, @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseSecondaryMode.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseSecondaryMode.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_a_standby_secondary..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_standby_mode.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_a_standby_secondary..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_database_standby_mode.py index 105f92dbf23a..a270469d50f6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_database_as_a_standby_secondary..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_standby_mode.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_database_as_a_standby_secondary..py + python create_database_standby_mode.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, @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDatabaseStandbyMode.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/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 new file mode 100644 index 000000000000..8daa04b83bb1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_vbs_enclave.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) 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_vbs_enclave.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={"location": "southeastasia", "properties": {"preferredEnclaveType": "VBS"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDatabaseVBSEnclave.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_restore_point_of_an_existing_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_pitr.py similarity index 91% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_restore_point_of_an_existing_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_pitr.py index 385dcf705b8f..b409d6b8172b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_restore_point_of_an_existing_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_pitr.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_restore_point_of_an_existing_database..py + python create_dw_database_cross_subscription_pitr.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, @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDwDatabaseCrossSubscriptionPITR.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDwDatabaseCrossSubscriptionPITR.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_geobackup..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_recovery.py similarity index 92% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_geobackup..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_recovery.py index 99677ff02201..a384ba708ff5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_geobackup..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_recovery.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_geobackup..py + python create_dw_database_cross_subscription_recovery.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, @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDwDatabaseCrossSubscriptionRecovery.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDwDatabaseCrossSubscriptionRecovery.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_backup_of_a_dropped_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_restore.py similarity index 91% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_backup_of_a_dropped_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_restore.py index c89af497538b..c80d67d8df46 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_backup_of_a_dropped_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_restore.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_data_warehouse_database_as_a_crosssubscription_restore_from_a_backup_of_a_dropped_database..py + python create_dw_database_cross_subscription_restore.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, @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateDwDatabaseCrossSubscriptionRestore.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateDwDatabaseCrossSubscriptionRestore.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/start_a_job_execution..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/start_a_job_execution..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution.py index 021b0726c701..140cae942888 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/start_a_job_execution..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python start_a_job_execution..py + python create_job_execution.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, 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 similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_database_extensions..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_database_extensions.py index 643efb7fcdc2..d45e2fd3a92d 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 @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_database_extensions..py + python create_or_update_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_an_instance_pool_with_all_properties..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_max.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_an_instance_pool_with_all_properties..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_max.py index f66ce1f7f3c2..588367a4b077 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_an_instance_pool_with_all_properties..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_an_instance_pool_with_all_properties..py + python create_or_update_instance_pool_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_an_instance_pool_with_min_properties..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_min.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_an_instance_pool_with_min_properties..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_min.py index 3bc69b19802e..952d96b98136 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_an_instance_pool_with_min_properties..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_an_instance_pool_with_min_properties..py + python create_or_update_instance_pool_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_agent.py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent.py index 1c911de35425..f066e0b16e8b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_a_job_agent.py + python create_or_update_job_agent.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_credential.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_credential.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_credential.py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_credential.py index e6d29846e86c..4138903a7b1f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_credential.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_credential.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_a_credential.py + python create_or_update_job_credential.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_execution.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_execution.py index 687c40dff430..e9838af25e90 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_execution.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_job_execution..py + python create_or_update_job_execution.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_job_with_all_properties_specified.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_max.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_job_with_all_properties_specified.py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_max.py index b38725304e76..aecc978f14d7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_job_with_all_properties_specified.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_job_with_all_properties_specified.py + python create_or_update_job_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_step_with_all_properties_specified..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_max.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_step_with_all_properties_specified..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_max.py index 423a45674431..7c9648df36f1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_step_with_all_properties_specified..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_a_job_step_with_all_properties_specified..py + python create_or_update_job_step_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_step_with_minimal_properties_specified..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_min.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_step_with_minimal_properties_specified..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_min.py index 86fa3bed198d..de2a5fce51c5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_job_step_with_minimal_properties_specified..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_a_job_step_with_minimal_properties_specified..py + python create_or_update_job_step_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_target_group_with_all_properties..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_max.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_target_group_with_all_properties..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_max.py index 91676e87059e..e8448ddf295a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_target_group_with_all_properties..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_a_target_group_with_all_properties..py + python create_or_update_job_target_group_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_target_group_with_minimal_properties..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_min.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_target_group_with_minimal_properties..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_min.py index 4fa4adc30b60..ec6451e2d78a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_target_group_with_minimal_properties..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_a_target_group_with_minimal_properties..py + python create_or_update_job_target_group_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sets_maintenance_window_settings_for_a_selected_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/sets_maintenance_window_settings_for_a_selected_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py index 3cee89a055e3..336f934359c1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sets_maintenance_window_settings_for_a_selected_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python sets_maintenance_window_settings_for_a_selected_database..py + python create_or_update_maintenance_windows.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_workload_group_with_all_properties_specified..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_workload_group_with_all_properties_specified..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_max.py index 4861744ff6ba..8cd1a27f308a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_workload_group_with_all_properties_specified..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_workload_group_with_all_properties_specified..py + python create_or_update_workload_classifier_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_workload_group_with_the_required_properties_specified..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_min.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_workload_group_with_the_required_properties_specified..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_min.py index 34696477b83c..821c37e5302d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_workload_group_with_the_required_properties_specified..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_workload_group_with_the_required_properties_specified..py + python create_or_update_workload_classifier_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, 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 new file mode 100644 index 000000000000..a14154818b23 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_max.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_workload_group_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.workload_groups.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + workload_group_name="smallrc", + parameters={ + "properties": { + "importance": "normal", + "maxResourcePercent": 100, + "maxResourcePercentPerRequest": 3, + "minResourcePercent": 0, + "minResourcePercentPerRequest": 3, + "queryExecutionTimeout": 0, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..60c8eb07ec8d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_min.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_workload_group_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.workload_groups.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + workload_group_name="smallrc", + parameters={ + "properties": {"maxResourcePercent": 100, "minResourcePercent": 0, "minResourcePercentPerRequest": 3} + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadGroupMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_vcore_database_by_specifying_service_objective_name..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_service_objective.py similarity index 92% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_vcore_database_by_specifying_service_objective_name..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_service_objective.py index f6b1f0a4326a..64b69569b15a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_vcore_database_by_specifying_service_objective_name..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_service_objective.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_vcore_database_by_specifying_service_objective_name..py + python create_vcore_database_by_service_objective.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateVCoreDatabaseByServiceObjective.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateVCoreDatabaseByServiceObjective.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_vcore_database_by_specifying_sku_name_and_capacity..py b/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_sku_name_capacity.py similarity index 92% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_vcore_database_by_specifying_sku_name_and_capacity..py rename to sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_sku_name_capacity.py index b0cf40c1847f..dad309baea08 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_vcore_database_by_specifying_sku_name_and_capacity..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_sku_name_capacity.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_vcore_database_by_specifying_sku_name_and_capacity..py + python create_vcore_database_by_sku_name_capacity.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/CreateVCoreDatabaseBySkuNameCapacity.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/CreateVCoreDatabaseBySkuNameCapacity.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_data_masking_policy_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_data_masking_policy_max.py rename to sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_max.py index 43934cd20cbf..ae81b6b823d8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_data_masking_policy_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_data_masking_policy_max.py + python data_masking_policy_create_or_update_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_data_masking_policy_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_min.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_data_masking_policy_min.py rename to sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_min.py index 74009b96afde..e5dc4141c90f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_data_masking_policy_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_data_masking_policy_min.py + python data_masking_policy_create_or_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_data_masking_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_data_masking_policy.py rename to sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_get.py index f2bd67dbb3a8..9c89c501ac62 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_data_masking_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_data_masking_policy.py + python data_masking_policy_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_default_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_default_max.py rename to sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_max.py index 2a1dce31dcdc..aeb43781c2ec 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_default_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create/_update_data_masking_rule_for_default_max.py + python data_masking_rule_create_or_update_default_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_default_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_min.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_default_min.py rename to sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_min.py index 65df1f4c3aa5..0825719a912b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_default_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create/_update_data_masking_rule_for_default_min.py + python data_masking_rule_create_or_update_default_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_numbers.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_number.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_numbers.py rename to sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_number.py index 786b2ceef87c..93e19a5bbce3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_numbers.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_number.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create/_update_data_masking_rule_for_numbers.py + python data_masking_rule_create_or_update_number.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_text.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_text.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_text.py rename to sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_text.py index b3e385313e4e..3b5529d59021 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create/_update_data_masking_rule_for_text.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_text.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create/_update_data_masking_rule_for_text.py + python data_masking_rule_create_or_update_text.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_data_masking_rules.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_data_masking_rules.py rename to sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_list.py index 9e261877c85e..6bb448a9bafc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_data_masking_rules.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_data_masking_rules.py + python data_masking_rule_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_datawarehouse_database_restore_point..py b/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_datawarehouse_database_restore_point..py rename to sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_get.py index 5593e6f8a120..819971d9d959 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_datawarehouse_database_restore_point..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_datawarehouse_database_restore_point..py + python data_warehouse_restore_points_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_datawarehouse_database_restore_points..py b/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_list_by_database.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_datawarehouse_database_restore_points..py rename to sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_list_by_database.py index a40398d73624..0f30207f8232 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_datawarehouse_database_restore_points..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_datawarehouse_database_restore_points..py + python data_warehouse_restore_points_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_advanced_threat_protection_settings_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_max.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_advanced_threat_protection_settings_with_all_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_max.py index d82b669f8098..57325df63a9a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_advanced_threat_protection_settings_with_all_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_database's_advanced_threat_protection_settings_with_all_parameters.py + python database_advanced_threat_protection_settings_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_advanced_threat_protection_settings_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_min.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_advanced_threat_protection_settings_with_minimal_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_min.py index bc5c9537c6b9..3faf0ec380cd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_advanced_threat_protection_settings_with_minimal_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_database's_advanced_threat_protection_settings_with_minimal_parameters.py + python database_advanced_threat_protection_settings_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_advanced_threat_protection_settings..py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_advanced_threat_protection_settings..py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_get.py index acdcabcab5ba..3a7550b1e6a6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_advanced_threat_protection_settings..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_database's_advanced_threat_protection_settings..py + python database_advanced_threat_protection_settings_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/lists_the_database's_advanced_threat_protection_settings..py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_list_by_database.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/lists_the_database's_advanced_threat_protection_settings..py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_list_by_database.py index 236c28eb22ce..a3c542c56f7f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/lists_the_database's_advanced_threat_protection_settings..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python lists_the_database's_advanced_threat_protection_settings..py + python database_advanced_threat_protection_settings_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_advisor.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_database_advisor.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_get.py index 863a53faafe2..0043467b95a7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_advisor.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_database_advisor.py + python database_advisor_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_advisors.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_advisors.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_list.py index b84bccb83a6d..a142bd2b282a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_advisors.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_of_database_advisors.py + python database_advisor_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_database_advisor.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_update.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_database_advisor.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_update.py index 861372080d3d..fee9f7de6ff1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_database_advisor.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_database_advisor.py + python database_advisor_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_audit_settings_of_a_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_auditing_settings_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_audit_settings_of_a_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_auditing_settings_list.py index 29e0cab3ae2e..831e4c171979 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_audit_settings_of_a_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_auditing_settings_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_audit_settings_of_a_database.py + python database_auditing_settings_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_automatic_tuning_settings.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_automatic_tuning_settings.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_get.py index df33b5c27185..5eb116e397ad 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_automatic_tuning_settings.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_database's_automatic_tuning_settings.py + python database_automatic_tuning_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_database_automatic_tuning_settings_with_all_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/updates_database_automatic_tuning_settings_with_all_properties.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_max.py index 936b93d4ef41..f949a0b4ab4e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_database_automatic_tuning_settings_with_all_properties.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python updates_database_automatic_tuning_settings_with_all_properties.py + python database_automatic_tuning_update_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_database_automatic_tuning_settings_with_minimal_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_min.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/updates_database_automatic_tuning_settings_with_minimal_properties.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_min.py index 558fd6cc93bf..70fa97ab92b9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_database_automatic_tuning_settings_with_minimal_properties.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python updates_database_automatic_tuning_settings_with_minimal_properties.py + python database_automatic_tuning_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_azure_monitor_auditing_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_azure_monitor_auditing_create_min.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_azure_monitor_auditing_policy_with_minimal_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_azure_monitor_auditing_create_min.py index 019675b3e998..3250f6f8186d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_azure_monitor_auditing_policy_with_minimal_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_azure_monitor_auditing_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_a_database's_azure_monitor_auditing_policy_with_minimal_parameters.py + python database_azure_monitor_auditing_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_blob_auditing_policy_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_blob_auditing_policy_with_all_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_max.py index 50a4d09fe861..cd43003f2028 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_blob_auditing_policy_with_all_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_a_database's_blob_auditing_policy_with_all_parameters.py + python database_blob_auditing_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_blob_auditing_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_min.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_blob_auditing_policy_with_minimal_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_min.py index 28e77e66be1e..baff274b6c05 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_database's_blob_auditing_policy_with_minimal_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_a_database's_blob_auditing_policy_with_minimal_parameters.py + python database_blob_auditing_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_blob_auditing_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_blob_auditing_policy.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_get.py index e414a8601bb8..9c1a9dfb21b4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_blob_auditing_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_database's_blob_auditing_policy.py + python database_blob_auditing_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_column.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_column_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_database_column.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_column_get.py index 5ab01f6050c6..adfc7272f2ca 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_column.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_column_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_database_column.py + python database_column_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, 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 new file mode 100644 index 000000000000..b56a1b4b68b7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_column_list_by_table.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) 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_column_list_by_table.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.database_columns.list_by_table( + resource_group_name="myRG", + server_name="serverName", + database_name="myDatabase", + schema_name="dbo", + table_name="table1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseColumnListByTable.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_extended_auditing_settings_of_a_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_extended_auditing_settings_list.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_extended_auditing_settings_of_a_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_extended_auditing_settings_list.py index 5144308e604e..ecd2d66ec9d9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_extended_auditing_settings_of_a_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_extended_auditing_settings_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_extended_auditing_settings_of_a_database.py + python database_extended_auditing_settings_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_definitions_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_definitions_list.py new file mode 100644 index 000000000000..e7be2d8528fe --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_definitions_list.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) 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_definitions_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="00000000-1111-2222-3333-444444444444", + ) + + response = client.databases.list_metric_definitions( + resource_group_name="sqlcrudtest-6730", + server_name="sqlcrudtest-9007", + database_name="3481", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsDefinitionsList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_usage_metrics.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_list_with_filter.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_database_usage_metrics.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_list_with_filter.py index 7779e30534d6..520bc953da70 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_usage_metrics.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_list_with_filter.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_database_usage_metrics.py + 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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_recommended_action.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_database_recommended_action.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_get.py index 71c5caea4277..c9ec704742c4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_recommended_action.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_database_recommended_action.py + python database_recommended_action_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_recommended_actions.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_recommended_actions.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list.py index 005bfed53b6c..3e63c55c2f9c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_recommended_actions.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_of_database_recommended_actions.py + python database_recommended_action_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_recommended_actions_for_all_advisors.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list_expand.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_recommended_actions_for_all_advisors.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list_expand.py index 809c57bef20e..29746fb88ad7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_database_recommended_actions_for_all_advisors.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list_expand.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_of_database_recommended_actions_for_all_advisors.py + python database_recommended_action_list_expand.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_database_recommended_action.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_update.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_database_recommended_action.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_update.py index 11f182963b73..2ae2710f5860 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_database_recommended_action.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_database_recommended_action.py + python database_recommended_action_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_restore_point..py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_restore_point..py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py index 17e0a6c0fb72..8dee415547a2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_restore_point..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python deletes_a_restore_point..py + python database_restore_points_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database_restore_point..py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database_restore_point..py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_get.py index cf2b7367c632..b46f7902b898 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database_restore_point..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_database_restore_point..py + python database_restore_points_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_restore_points..py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_list_by_database.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_database_restore_points..py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_list_by_database.py index e1f06b6d98ad..dfed545b9981 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_restore_points..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_database_restore_points..py + python database_restore_points_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_datawarehouse_database_restore_point..py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_post.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_datawarehouse_database_restore_point..py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_post.py index 44a271294cb1..73dc7bcf5aa5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_datawarehouse_database_restore_point..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_post.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_datawarehouse_database_restore_point..py + python database_restore_points_post.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_database_schema.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_schema_get.py index e9c914f1d945..ff3900ead894 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_database_schema.py + python database_schema_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_schemas.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_list_by_database.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_database_schemas.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_schema_list_by_database.py index 92d004abbf09..b3897e68aea9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_schemas.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_database_schemas.py + python database_schema_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_threat_detection_policy_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_threat_detection_policy_with_all_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_max.py index 4828bdfc7fab..a5177beeb6e1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_threat_detection_policy_with_all_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_database's_threat_detection_policy_with_all_parameters.py + python database_security_alert_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_threat_detection_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_min.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_threat_detection_policy_with_minimal_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_min.py index 38653fcbf1a4..c3e30b8314f9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_threat_detection_policy_with_minimal_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_database's_threat_detection_policy_with_minimal_parameters.py + python database_security_alert_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_threat_detection_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_threat_detection_policy.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_get.py index b90ad17dd08b..379d5e7906a6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_threat_detection_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_database's_threat_detection_policy.py + python database_security_alert_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_database's_threat_detection_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_list_by_database.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_database's_threat_detection_policies.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_list_by_database.py index 972cd407262f..6699bab786df 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_database's_threat_detection_policies.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_database's_threat_detection_policies.py + python database_security_alert_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/add_a_database's_vulnerability_assessment_rule_baseline_list..py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/add_a_database's_vulnerability_assessment_rule_baseline_list..py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py index e5fbd295fac8..816812ab3109 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/add_a_database's_vulnerability_assessment_rule_baseline_list..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python add_a_database's_vulnerability_assessment_rule_baseline_list..py + python database_sql_vulnerability_assessment_baseline_add.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/add_a_database's_vulnerability_assessment_rule_baseline_from_the_latest_scan_result..py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/add_a_database's_vulnerability_assessment_rule_baseline_from_the_latest_scan_result..py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py index fd0e993150e1..288766e2d07d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/add_a_database's_vulnerability_assessment_rule_baseline_from_the_latest_scan_result..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python add_a_database's_vulnerability_assessment_rule_baseline_from_the_latest_scan_result..py + python database_sql_vulnerability_assessment_baseline_add_latest.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, 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 new file mode 100644 index 000000000000..f7f59f2fd0f9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.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) 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_sql_vulnerability_assessment_baseline_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.database_sql_vulnerability_assessment_baselines.get( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + baseline_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_database's_sql_vulnerability_assessment_rule_baselines..py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_database's_sql_vulnerability_assessment_rule_baselines..py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py index cc8626b62896..eb0331c24327 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_database's_sql_vulnerability_assessment_rule_baselines..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_list_of_database's_sql_vulnerability_assessment_rule_baselines..py + python database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policy_for_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policy_for_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py index de7b638bcb88..37dfcc560683 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policy_for_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_sql_vulnerability_assessment_policy_for_database.py + python database_sql_vulnerability_assessment_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policies_on_a_given_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policies_on_a_given_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py index 8e96bad3c169..e8dc23f334e7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policies_on_a_given_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_sql_vulnerability_assessment_policies_on_a_given_database.py + python database_sql_vulnerability_assessment_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_sql_vulnerability_assessment_scan_results_for_scan_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_database_sql_vulnerability_assessment_scan_results_for_scan_id.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py index 1f5d5493e24d..21b6ca02ccc5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_sql_vulnerability_assessment_scan_results_for_scan_id.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_database_sql_vulnerability_assessment_scan_results_for_scan_id.py + python database_sql_vulnerability_assessment_list_scans_results.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, 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 new file mode 100644 index 000000000000..37a60c75f9c9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_sql_vulnerability_assessment_rule_baseline_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.database_sql_vulnerability_assessment_rule_baselines.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + baseline_name="default", + rule_id="VA1001", + parameters={ + "properties": { + "latestScan": False, + "results": [["userA", "SELECT"], ["userB", "SELECT"], ["userC", "SELECT"]], + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/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 new file mode 100644 index 000000000000..2258d6821930 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_delete.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) 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_sql_vulnerability_assessment_rule_baseline_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.database_sql_vulnerability_assessment_rule_baselines.delete( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + baseline_name="default", + rule_id="VA1001", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database's_sql_vulnerability_assessment_rule_baseline..py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database's_sql_vulnerability_assessment_rule_baseline..py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py index 5401f05302bc..bfbc378838fa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database's_sql_vulnerability_assessment_rule_baseline..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_database's_sql_vulnerability_assessment_rule_baseline..py + python database_sql_vulnerability_assessment_rule_baseline_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, 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 new file mode 100644 index 000000000000..89bf3f72618d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.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) 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_sql_vulnerability_assessment_rule_baseline_list_by_baseline.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.database_sql_vulnerability_assessment_rule_baselines.list_by_baseline( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + baseline_name="default", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineListByBaseline.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessment_scan..py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessment_scan..py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py index 52b1a153b390..45fcf2070d00 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessment_scan..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_database's_vulnerability_assessment_scan..py + python database_sql_vulnerability_assessment_scan.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, 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 new file mode 100644 index 000000000000..c17ce4e94c7a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.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) 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_sql_vulnerability_assessment_scan_records_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.database_sql_vulnerability_assessment_scans.list_by_sql_vulnerability_assessments( + resource_group_name="vulnerabilityassessmenttest-4711", + server_name="vulnerabilityassessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/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 new file mode 100644 index 000000000000..1ccd2f4803dc --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_execute.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) 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_sql_vulnerability_assessment_scans_execute.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.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/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScansExecute.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py index d5090822c4a7..13a4fdc9949f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.py + python database_sql_vulnerability_assessment_scans_results.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_table.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_table_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_database_table.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_table_get.py index 0c0884f4a4bc..b7870d72226b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_table.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_table_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_database_table.py + python database_table_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_tables.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_table_list_by_schema.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_database_tables.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_table_list_by_schema.py index 4cea9acfa4f6..00d3bd285bfe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_tables.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_table_list_by_schema.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_database_tables.py + python database_table_list_by_schema.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_container_sas_key_min.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_container_sas_key_min.py index 3304b11f33e5..7f3739623d48 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_container_sas_key_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py + python database_vulnerability_assessment_create_container_sas_key_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_all_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_max.py index 8b8bda67437a..ecd652baddd7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_all_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_database's_vulnerability_assessment_with_all_parameters.py + python database_vulnerability_assessment_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_storage_access_key_min.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_storage_access_key_min.py index 54e34cc11b0f..64923bb89229 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_storage_access_key_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_database's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py + python database_vulnerability_assessment_create_storage_access_key_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/remove_a_database's_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/remove_a_database's_vulnerability_assessment.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py index 59366cfef4e0..4ac95e8e8dec 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/remove_a_database's_vulnerability_assessment.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python remove_a_database's_vulnerability_assessment.py + python database_vulnerability_assessment_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessment.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_get.py index ffe9f388234c..68c3830d57a7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessment.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_database's_vulnerability_assessment.py + python database_vulnerability_assessment_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_database's_vulnerability_assessment_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_list_by_database.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_database's_vulnerability_assessment_policies.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_list_by_database.py index b717dbd83fd5..20a4ce517bac 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_database's_vulnerability_assessment_policies.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_database's_vulnerability_assessment_policies.py + python database_vulnerability_assessment_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_database's_vulnerability_assessment_rule_baseline..py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_create.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_database's_vulnerability_assessment_rule_baseline..py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_create.py index d588636798ce..a9b0b47285d1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_database's_vulnerability_assessment_rule_baseline..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_or_updates_a_database's_vulnerability_assessment_rule_baseline..py + python database_vulnerability_assessment_rule_baseline_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/removes_a_database's_vulnerability_assessment_rule_baseline..py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/removes_a_database's_vulnerability_assessment_rule_baseline..py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py index 421b548119c8..b1c764149d26 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/removes_a_database's_vulnerability_assessment_rule_baseline..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python removes_a_database's_vulnerability_assessment_rule_baseline..py + python database_vulnerability_assessment_rule_baseline_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database's_vulnerability_assessment_rule_baseline..py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database's_vulnerability_assessment_rule_baseline..py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_get.py index f4e314388c40..2e379f723e35 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database's_vulnerability_assessment_rule_baseline..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_database's_vulnerability_assessment_rule_baseline..py + python database_vulnerability_assessment_rule_baseline_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/export_a_database's_vulnerability_assessment_scan_results..py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_export.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/export_a_database's_vulnerability_assessment_scan_results..py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_export.py index 53088c821b11..47a7a0f97557 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/export_a_database's_vulnerability_assessment_scan_results..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_export.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python export_a_database's_vulnerability_assessment_scan_results..py + python database_vulnerability_assessment_scan_export.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database_vulnerability_assessment_scan_record_by_scan_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_get.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database_vulnerability_assessment_scan_record_by_scan_id.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_get.py index a41f28cb580d..ed166af197e8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database_vulnerability_assessment_scan_record_by_scan_id.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_database_vulnerability_assessment_scan_record_by_scan_id.py + python database_vulnerability_assessment_scan_records_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_list_of_a_database_vulnerability_assessment_scan_records.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_list_by_database.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_the_list_of_a_database_vulnerability_assessment_scan_records.py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_list_by_database.py index 6c17745b8cda..2538bf56fcfd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_list_of_a_database_vulnerability_assessment_scan_records.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_the_list_of_a_database_vulnerability_assessment_scan_records.py + python database_vulnerability_assessment_scan_records_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/executes_a_database's_vulnerability_assessment_scan..py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/executes_a_database's_vulnerability_assessment_scan..py rename to sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py index 468eff27955d..e67ddb60d072 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/executes_a_database's_vulnerability_assessment_scan..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python executes_a_database's_vulnerability_assessment_scan..py + python database_vulnerability_assessment_scans_execute.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py index 79b59f173dbb..34e2113c8729 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python deletes_a_database..py + python delete_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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DeleteDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/DeleteDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_an_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_an_instance_pool.py rename to sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py index 11728a99db2c..ae1fe71503a5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_an_instance_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_an_instance_pool.py + python delete_instance_pool.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job.py rename to sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py index b4321f1f1830..e674d63eae37 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_a_job.py + python delete_job.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job_agent.py rename to sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py index 442ff698848d..1910de35326f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_a_job_agent.py + python delete_job_agent.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_credential.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_a_credential.py rename to sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py index 169b502913e0..37449770b808 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_credential.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_a_credential.py + python delete_job_credential.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job_step..py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job_step..py rename to sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py index cab088a4c75b..56053116c258 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_job_step..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_a_job_step..py + python delete_job_step.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_target_group..py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_a_target_group..py rename to sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py index 9d2bbaa427af..dde433114f55 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_target_group..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_a_target_group..py + python delete_job_target_group.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_workload_classifier.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_a_workload_classifier.py rename to sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py index c9c3e49c43ca..0bd4c3f8ea38 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_workload_classifier.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_a_workload_classifier.py + python delete_workload_classifier.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_workload_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_a_workload_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py index 69b6ee066564..fcd45ca4b5dd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_workload_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_a_workload_group.py + python delete_workload_group.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_deleted_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_deleted_server.py rename to sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_get.py index 8740a384d4cf..04eb62fe0e40 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_deleted_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_deleted_server.py + python deleted_server_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_deleted_servers.py b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_deleted_servers.py rename to sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list.py index ac6f926ea97e..d4e33138e134 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_deleted_servers.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_deleted_servers.py + python deleted_server_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_deleted_servers_in_a_subscription.py b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list_by_subscription.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_deleted_servers_in_a_subscription.py rename to sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list_by_subscription.py index a3fef55824e7..86548b545cf6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_deleted_servers_in_a_subscription.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list_by_subscription.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_deleted_servers_in_a_subscription.py + python deleted_server_list_by_subscription.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recover_deleted_server..py b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_recover.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/recover_deleted_server..py rename to sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_recover.py index 0cd477140983..cab27856101c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/recover_deleted_server..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_recover.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python recover_deleted_server..py + python deleted_server_recover.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_distributed_availability_group..py b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_distributed_availability_group..py rename to sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create.py index d35644aaa2f4..8d1eca0c6e45 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_distributed_availability_group..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_distributed_availability_group..py + python distributed_availability_groups_create.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/initiate_a_distributed_availability_group_drop..py b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_delete.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/initiate_a_distributed_availability_group_drop..py rename to sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_delete.py index 4d3cfbfe97d1..aef8a014a7c4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/initiate_a_distributed_availability_group_drop..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python initiate_a_distributed_availability_group_drop..py + python distributed_availability_groups_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_distributed_availability_group_info..py b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_the_distributed_availability_group_info..py rename to sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_get.py index 0e02c864f1ef..3866f48340d0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_distributed_availability_group_info..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_the_distributed_availability_group_info..py + python distributed_availability_groups_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/lists_all_distributed_availability_groups_in_instance..py b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_list_by_instance.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/lists_all_distributed_availability_groups_in_instance..py rename to sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_list_by_instance.py index 3c1c04cf6a77..7c5cf95badde 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/lists_all_distributed_availability_groups_in_instance..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_list_by_instance.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python lists_all_distributed_availability_groups_in_instance..py + python distributed_availability_groups_list_by_instance.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_distributed_availability_group_replication_mode_before_deleting_it..py b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_update.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_the_distributed_availability_group_replication_mode_before_deleting_it..py rename to sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_update.py index 49476ac4edfc..62c13e4b68fc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_distributed_availability_group_replication_mode_before_deleting_it..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_the_distributed_availability_group_replication_mode_before_deleting_it..py + python distributed_availability_groups_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_activity.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_activity_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_activity.py rename to sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_activity_list.py index 6649028a10c7..302e9555e80d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_activity.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_activity_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_elastic_pool_activity.py + python elastic_pool_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_all_parameter.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_all_parameter.py rename to sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_max.py index 88badd877eeb..b4ea98d420ee 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_all_parameter.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_elastic_pool_with_all_parameter.py + python elastic_pool_create_or_update_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_minimum_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_min.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_minimum_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_min.py index 3a48bb094b73..3c076f92d377 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_minimum_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_elastic_pool_with_minimum_parameters.py + python elastic_pool_create_or_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_maintenance_configuration_parameter.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_set_maintenance_configuration.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_maintenance_configuration_parameter.py rename to sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_set_maintenance_configuration.py index 8794dcc188c5..e025dd667b01 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_elastic_pool_with_maintenance_configuration_parameter.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_set_maintenance_configuration.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_elastic_pool_with_maintenance_configuration_parameter.py + python elastic_pool_create_or_update_set_maintenance_configuration.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_database_activity.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_database_activity_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_database_activity.py rename to sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_database_activity_list.py index 6feae36902c0..3582f91c9b25 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_database_activity.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_database_activity_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_elastic_pool_database_activity.py + 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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_an_elastic_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_an_elastic_pool.py rename to sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py index 5eb6fc33ceac..91ff54482fd3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_an_elastic_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_an_elastic_pool.py + python elastic_pool_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_an_elastic_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_an_elastic_pool.py rename to sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get.py index d6357fa51225..af2c4190a2d1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_an_elastic_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_an_elastic_pool.py + python elastic_pool_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_elastic_pools_in_a_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_list_by_server.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_all_elastic_pools_in_a_server.py rename to sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_list_by_server.py index e0fdf996004e..d408d9b19f84 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_elastic_pools_in_a_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_list_by_server.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_all_elastic_pools_in_a_server.py + python elastic_pool_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_definitions_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_definitions_list.py new file mode 100644 index 000000000000..5ad837baa643 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_definitions_list.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) 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_definitions_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="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", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsDefinitionsList.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 new file mode 100644 index 000000000000..dfb5613f3f66 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_list_with_filter.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) 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/assigns_maintenance_configuration_to_an_elastic_pool..py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_assign_maintenance_configuration.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/assigns_maintenance_configuration_to_an_elastic_pool..py rename to sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_assign_maintenance_configuration.py index f581f43deafa..67b80b764014 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/assigns_maintenance_configuration_to_an_elastic_pool..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_assign_maintenance_configuration.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python assigns_maintenance_configuration_to_an_elastic_pool..py + python elastic_pool_update_assign_maintenance_configuration.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_an_elastic_pool_with_all_parameter.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_max.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_an_elastic_pool_with_all_parameter.py rename to sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_max.py index 8bd7585e13ca..424e8a614e0e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_an_elastic_pool_with_all_parameter.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_an_elastic_pool_with_all_parameter.py + python elastic_pool_update_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resets_maintenance_configuration_of_an_elastic_pool_to_default..py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_reset_maintenance_configuration.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/resets_maintenance_configuration_of_an_elastic_pool_to_default..py rename to sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_reset_maintenance_configuration.py index be537145c7cb..8c6f10aa554c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resets_maintenance_configuration_of_an_elastic_pool_to_default..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_reset_maintenance_configuration.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python resets_maintenance_configuration_of_an_elastic_pool_to_default..py + python elastic_pool_update_reset_maintenance_configuration.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_encryption_protector_to_key_vault.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_the_encryption_protector_to_key_vault.py rename to sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault.py index 74c85e1453a9..da4d39007c95 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_encryption_protector_to_key_vault.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_the_encryption_protector_to_key_vault.py + python encryption_protector_create_or_update_key_vault.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_encryption_protector_to_service_managed.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_service_managed.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_the_encryption_protector_to_service_managed.py rename to sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_service_managed.py index b3e96cc06016..8a506752ef4f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_encryption_protector_to_service_managed.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_service_managed.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_the_encryption_protector_to_service_managed.py + python encryption_protector_create_or_update_service_managed.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_encryption_protector.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_encryption_protector.py rename to sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get.py index 9a69eb7ce5bf..416e64d747a7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_encryption_protector.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_encryption_protector.py + python encryption_protector_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_encryption_protectors_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_list.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_encryption_protectors_by_server.py rename to sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_list.py index b3d472a42579..0218e7d4d479 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_encryption_protectors_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_encryption_protectors_by_server.py + python encryption_protector_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/revalidates_the_encryption_protector.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/revalidates_the_encryption_protector.py rename to sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.py index 3b48890a63b8..467457b3bd41 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/revalidates_the_encryption_protector.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python revalidates_the_encryption_protector.py + python encryption_protector_revalidate.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_an_endpoint_certificate..py b/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_an_endpoint_certificate..py rename to sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_get.py index 631e349764f3..d85808a300d9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_an_endpoint_certificate..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_an_endpoint_certificate..py + python endpoint_certificates_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_endpoint_certificates..py b/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_list_by_instance.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_endpoint_certificates..py rename to sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_list_by_instance.py index d541ea9c1d60..06ea4ecf4869 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_endpoint_certificates..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_list_by_instance.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_list_of_endpoint_certificates..py + python endpoint_certificates_list_by_instance.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/exports_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/export_database.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/exports_a_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/export_database.py index 400584649dc7..4495f1f452ed 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/exports_a_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/export_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python exports_a_database..py + python export_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, @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ExportDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ExportDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/exports_a_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..py b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_network_isolation.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/exports_a_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..py rename to sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_network_isolation.py index a1ddd2286db8..4f3f11533d69 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/exports_a_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_network_isolation.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python exports_a_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..py + python export_database_with_network_isolation.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, @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ExportDatabaseWithNetworkIsolation.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ExportDatabaseWithNetworkIsolation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_azure_monitor_auditing_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_azure_monitor_auditing_create_min.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_azure_monitor_auditing_policy_with_minimal_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/extended_database_azure_monitor_auditing_create_min.py index 9e1ee67c4c6b..484d98f1b65f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_azure_monitor_auditing_policy_with_minimal_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_azure_monitor_auditing_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_an_extended_database's_azure_monitor_auditing_policy_with_minimal_parameters.py + python extended_database_azure_monitor_auditing_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_blob_auditing_policy_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_blob_auditing_policy_with_all_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_max.py index 55c01023aeff..45a3174a00e9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_blob_auditing_policy_with_all_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_an_extended_database's_blob_auditing_policy_with_all_parameters.py + python extended_database_blob_auditing_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_blob_auditing_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_min.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_blob_auditing_policy_with_minimal_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_min.py index ebc6e28f47d1..a43e48fa3a94 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_an_extended_database's_blob_auditing_policy_with_minimal_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_an_extended_database's_blob_auditing_policy_with_minimal_parameters.py + python extended_database_blob_auditing_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_an_extended_database's_blob_auditing_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_an_extended_database's_blob_auditing_policy.py rename to sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_get.py index 46bcdc509713..49f60a8b01ec 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_an_extended_database's_blob_auditing_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_an_extended_database's_blob_auditing_policy.py + python extended_database_blob_auditing_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_extended_blob_auditing_policy_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_extended_blob_auditing_policy_with_all_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_max.py index dd0d952a5d1a..7d6f2ad4d3c7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_extended_blob_auditing_policy_with_all_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_server's_extended_blob_auditing_policy_with_all_parameters.py + python extended_server_blob_auditing_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_extended_blob_auditing_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_min.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_extended_blob_auditing_policy_with_minimal_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_min.py index 58ca2ddbaeeb..5be96c138cfa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_extended_blob_auditing_policy_with_minimal_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_server's_extended_blob_auditing_policy_with_minimal_parameters.py + python extended_server_blob_auditing_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_blob_extended_auditing_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_blob_extended_auditing_policy.py rename to sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_get.py index d25f7ea28f5a..37c09e531a4b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_blob_extended_auditing_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_server's_blob_extended_auditing_policy.py + python extended_server_blob_auditing_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_an_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/failover_an_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py index cf505e340eea..3ad026496905 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_an_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python failover_an_database.py + python failover_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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/FailoverDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/FailoverDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_an_elastic_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/failover_an_elastic_pool.py rename to sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py index 1848d3199517..737ae80c3f67 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_an_elastic_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python failover_an_elastic_pool.py + python failover_elastic_pool.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_failover_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_failover_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update.py index 2e1c34153506..7361035822f1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_failover_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_failover_group.py + python failover_group_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_failover_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_failover_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/failover_group_delete.py index ab3e7b9d8825..752e6920c641 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_failover_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_failover_group.py + python failover_group_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/planned_failover_of_a_failover_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_failover.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/planned_failover_of_a_failover_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/failover_group_failover.py index c4cc60f62448..ef197914664c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/planned_failover_of_a_failover_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_failover.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python planned_failover_of_a_failover_group.py + python failover_group_failover.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/forced_failover_of_a_failover_group_allowing_data_loss.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_force_failover_allow_data_loss.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/forced_failover_of_a_failover_group_allowing_data_loss.py rename to sdk/sql/azure-mgmt-sql/generated_samples/failover_group_force_failover_allow_data_loss.py index dbc4adb86298..f3cdaf43be42 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/forced_failover_of_a_failover_group_allowing_data_loss.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_force_failover_allow_data_loss.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python forced_failover_of_a_failover_group_allowing_data_loss.py + python failover_group_force_failover_allow_data_loss.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_failover_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_failover_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/failover_group_get.py index 2a5d41f54557..a128a58374a6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_failover_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_failover_group.py + python failover_group_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_failover_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_failover_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/failover_group_list.py index 9eceaee7e4c7..8d53d19722dd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_failover_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_failover_group.py + python failover_group_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_failover_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_failover_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update.py index ef6145354a9a..aab88e20be6d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_failover_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_failover_group.py + python failover_group_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_a_managed_instance..py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_managed_instance.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/failover_a_managed_instance..py rename to sdk/sql/azure-mgmt-sql/generated_samples/failover_managed_instance.py index 7d620328daca..d875350121bf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_a_managed_instance..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_managed_instance.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python failover_a_managed_instance..py + python failover_managed_instance.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_firewall_rule_max/min.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_create.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_firewall_rule_max/min.py rename to sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_create.py index 4ac40cbc363a..6836e5bd7f14 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_firewall_rule_max/min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_firewall_rule_max/min.py + python 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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_firewall_rule.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_a_firewall_rule.py rename to sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py index 33265246d7a2..0e1e24370a3f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_firewall_rule.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_a_firewall_rule.py + python firewall_rule_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_firewall_rule.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_get.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_firewall_rule.py rename to sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_get.py index 61025f562920..3d525b8784bc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_firewall_rule.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_firewall_rule.py + python firewall_rule_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_firewall_rules.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_firewall_rules.py rename to sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_list.py index af628124ade3..7a29f4070b04 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_firewall_rules.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_firewall_rules.py + python firewall_rule_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replace_firewall_rules.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_replace.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/replace_firewall_rules.py rename to sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_replace.py index a67b6bbe39c8..45c2d6090f46 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/replace_firewall_rules.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_replace.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python replace_firewall_rules.py + python firewall_rule_replace.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_firewall_rule_max/min.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_update.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_firewall_rule_max/min.py rename to sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_update.py index 4082173bb5c7..eb1f687bb3d3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_firewall_rule_max/min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_firewall_rule_max/min.py + python firewall_rule_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_geo_backup_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_create_or_update.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_geo_backup_policy.py rename to sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_create_or_update.py index ec6feb21027c..b1f7abe48b8c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_geo_backup_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_create_or_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_geo_backup_policy.py + python geo_backup_policies_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_geo_backup_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_geo_backup_policy.py rename to sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_get.py index f5e2fbe74f52..9fea1e16d09e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_geo_backup_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_geo_backup_policy.py + python geo_backup_policies_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_geo_backup_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_geo_backup_policies.py rename to sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_list.py index b5b6df7ccf63..e17e959b1c6e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_geo_backup_policies.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_geo_backup_policies.py + python geo_backup_policies_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_the_user_activities_of_a_data_warehouse.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_data_warehouse_user_activities.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_the_user_activities_of_a_data_warehouse.py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_data_warehouse_user_activities.py index 109037f2e780..ef556167341c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_the_user_activities_of_a_data_warehouse.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_data_warehouse_user_activities.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_list_of_the_user_activities_of_a_data_warehouse.py + python get_data_warehouse_user_activities.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, 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 similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions..py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions.py index cdc030703ff6..3220104022b0 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 @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_database_extensions..py + python get_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_database_usages..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_usages.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_database_usages..py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_database_usages.py index b2d6e68be5ae..1e15d100eea9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_database_usages..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_usages.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_database_usages..py + python get_database_usages.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_an_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_an_instance_pool.py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool.py index 50caecfccf39..71fe04535a1d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_an_instance_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_an_instance_pool.py + python get_instance_pool.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_job.py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_job.py index cfdae5193465..fc93f8f7c280 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_job.py + python get_job.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_agent.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_agent.py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_job_agent.py index cce8aed2ff18..5c6e1c00c41b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_agent.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_job_agent.py + python get_job_agent.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_credential.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_credential.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_credential.py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_job_credential.py index 51c98f57dabd..8a64641be748 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_credential.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_credential.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_credential.py + python get_job_credential.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_execution..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_execution..py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution.py index 68c96615fd45..c3c73057e9ce 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_execution..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_job_execution..py + python get_job_execution.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_step_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_step.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_step_execution.py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_step.py index c7d96ac36cbf..8fcec1ced544 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_step_execution.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_step.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_job_step_execution.py + python get_job_execution_step.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_step_target_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_target.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_step_target_execution.py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_target.py index e98f1d0d0204..06685247afab 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_job_step_target_execution.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_target.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_job_step_target_execution.py + python get_job_execution_target.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_latest_version_of_a_job_step..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_job.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_latest_version_of_a_job_step..py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_job.py index cb0939974f87..4967545777aa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_latest_version_of_a_job_step..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_job.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_latest_version_of_a_job_step..py + python get_job_step_by_job.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_specified_version_of_a_job_step..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_version.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_specified_version_of_a_job_step..py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_version.py index 26062f9942e8..1008d8a8bfb4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_specified_version_of_a_job_step..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_version.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_specified_version_of_a_job_step..py + python get_job_step_by_version.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_target_group..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_target_group.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_target_group..py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_job_target_group.py index 03b7b3915bd2..a722407b746e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_target_group..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_target_group.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_target_group..py + python get_job_target_group.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_version_of_a_job..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_version.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_version_of_a_job..py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_job_version.py index 8829512f1280..51f069d057b2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_version_of_a_job..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_version.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_version_of_a_job..py + python get_job_version.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_short_term_retention_policy_list_for_the_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_short_term_retention_policy_list_for_the_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy.py index 54e1f65a5e1a..f5b85619fe19 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_short_term_retention_policy_list_for_the_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_short_term_retention_policy_list_for_the_database..py + python get_list_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, 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 new file mode 100644 index 000000000000..9f061ebc9987 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy_restorable_dropped.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) 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_list_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_restorable_dropped_database_backup_short_term_retention_policies.list_by_restorable_dropped_database( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="testsvr", + restorable_dropped_database_id="testdb,131403269876900000", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetListManagedShortTermRetentionPolicyRestorableDropped.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_available_maintenance_windows_for_a_selected_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_window_options.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_available_maintenance_windows_for_a_selected_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_window_options.py index a9aa56cf3947..ac9a65dfad37 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_available_maintenance_windows_for_a_selected_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_window_options.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_list_of_available_maintenance_windows_for_a_selected_database..py + python get_maintenance_window_options.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_maintenance_window_settings_for_a_selected_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_windows.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_maintenance_window_settings_for_a_selected_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_windows.py index 180515395cb9..0a323beb8df9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_maintenance_window_settings_for_a_selected_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_windows.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_maintenance_window_settings_for_a_selected_database..py + python get_maintenance_windows.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_managed_instance_management_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_operation.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_the_managed_instance_management_operation.py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_operation.py index 14b68a83077b..0a86b623f1fb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_managed_instance_management_operation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_operation.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_the_managed_instance_management_operation.py + python get_managed_instance_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_short_term_retention_policy_for_the_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_short_term_retention_policy_for_the_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy.py index e4fe4d76b4c7..e283f5a2c9fd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_short_term_retention_policy_for_the_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_short_term_retention_policy_for_the_database..py + python get_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, 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 new file mode 100644 index 000000000000..489df0a0f1e5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy_restorable_dropped.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) 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_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.managed_restorable_dropped_database_backup_short_term_retention_policies.get( + resource_group_name="Default-SQL-SouthEastAsia", + managed_instance_name="testsvr", + restorable_dropped_database_id="testdb,131403269876900000", + policy_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedShortTermRetentionPolicyRestorableDropped.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_recoverable_databases_by_managed_instances.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_recoverable_managed_database.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_recoverable_databases_by_managed_instances.py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_recoverable_managed_database.py index a4979f168c7d..8cda3453abf0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_recoverable_databases_by_managed_instances.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_recoverable_managed_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_recoverable_databases_by_managed_instances.py + python get_recoverable_managed_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_restorable_dropped_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_restorable_dropped_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database.py index 6f2b4002e452..98be3cabb77c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_restorable_dropped_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_restorable_dropped_database..py + python get_restorable_dropped_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_restorable_dropped_managed_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_managed_database.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_restorable_dropped_managed_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_managed_database.py index da10c9882d9c..aebe96b334c1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_restorable_dropped_managed_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_managed_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_restorable_dropped_managed_database..py + python get_restorable_dropped_managed_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, 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 new file mode 100644 index 000000000000..0fb6e882f1d1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_short_term_retention_policy.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) 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_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.backup_short_term_retention_policies.get( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + policy_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetShortTermRetentionPolicy.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database.py index ddef0547c20f..81af97d69edc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_database..py + python get_vcore_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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/GetVCoreDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/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 new file mode 100644 index 000000000000..c78aa20af8ee --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_default_enclave.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_default_enclave.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/preview/2022-05-01-preview/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 new file mode 100644 index 000000000000..94b4712d6c9a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_vbs_enclave.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_vbs_enclave.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/preview/2022-05-01-preview/examples/GetVCoreDatabaseVBSEnclave.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_workload_classifier_for_a_data_warehouse.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_workload_classifier_for_a_data_warehouse.py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier.py index 463936575cd5..e7468437a3c3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_workload_classifier_for_a_data_warehouse.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_workload_classifier_for_a_data_warehouse.py + python get_workload_classifier.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_workload_classifiers_for_a_workload_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier_list.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_workload_classifiers_for_a_workload_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier_list.py index 94d20b68661a..310b5bd9b53f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_workload_classifiers_for_a_workload_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_list_of_workload_classifiers_for_a_workload_group.py + python get_workload_classifier_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_workload_group_for_a_data_warehouse.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_workload_group_for_a_data_warehouse.py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group.py index 6d26c42f34c3..9955c76c4cbd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_workload_group_for_a_data_warehouse.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_workload_group_for_a_data_warehouse.py + python get_workload_group.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_workload_groups_for_a_data_warehouse.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group_list.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_workload_groups_for_a_data_warehouse.py rename to sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group_list.py index 14ccc8fb57cb..96b2e55f21e5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_list_of_workload_groups_for_a_data_warehouse.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_list_of_workload_groups_for_a_data_warehouse.py + python get_workload_group_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_hyperscale_elastic_pool_with_high_availability_replica_count_parameter.py b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_hyperscale_elastic_pool_with_high_availability_replica_count_parameter.py rename to sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.py index 5835b85251d4..1bda012728e1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_hyperscale_elastic_pool_with_high_availability_replica_count_parameter.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_hyperscale_elastic_pool_with_high_availability_replica_count_parameter.py + python hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_hyperscale_elastic_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_hyperscale_elastic_pool.py rename to sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_get.py index 9cce79460d48..16af11e7a244 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_hyperscale_elastic_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_hyperscale_elastic_pool.py + python hyperscale_elastic_pool_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_high_availability_replica_count_of_a_hyperscale_elastic_pool..py b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_update_set_high_availability_replica_count.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_high_availability_replica_count_of_a_hyperscale_elastic_pool..py rename to sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_update_set_high_availability_replica_count.py index b39934d80013..eabcbf7d60e9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_high_availability_replica_count_of_a_hyperscale_elastic_pool..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_update_set_high_availability_replica_count.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_high_availability_replica_count_of_a_hyperscale_elastic_pool..py + python hyperscale_elastic_pool_update_set_high_availability_replica_count.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_an_existing_empty_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/import_database.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/imports_to_an_existing_empty_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/import_database.py index 30cf33c398da..05a7b73e024b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_an_existing_empty_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python imports_to_an_existing_empty_database..py + python import_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, @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ImportDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ImportDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_an_existing_empty_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..py b/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_network_isolation.py similarity index 92% rename from sdk/sql/azure-mgmt-sql/generated_samples/imports_to_an_existing_empty_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..py rename to sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_network_isolation.py index 254d1b248c2c..4f6b108fbe7f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_an_existing_empty_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_network_isolation.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python imports_to_an_existing_empty_database,_using_private_link_to_communicate_with_sql_server_and_storage_account..py + python import_database_with_network_isolation.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, @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ImportDatabaseWithNetworkIsolation.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ImportDatabaseWithNetworkIsolation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_a_new_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/imports_to_a_new_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/import_new_database.py index d18f59358748..945b426e91f2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_a_new_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python imports_to_a_new_database..py + python import_new_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_a_new_database,_using_private_link_for_the_sql_server_and_storage_account..py b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_network_isolation.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/imports_to_a_new_database,_using_private_link_for_the_sql_server_and_storage_account..py rename to sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_network_isolation.py index ea6a0291dccd..1a8273b45cf0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/imports_to_a_new_database,_using_private_link_for_the_sql_server_and_storage_account..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_network_isolation.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python imports_to_a_new_database,_using_private_link_for_the_sql_server_and_storage_account..py + python import_new_database_with_network_isolation.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_inaccessible_managed_databases_by_managed_instances.py b/sdk/sql/azure-mgmt-sql/generated_samples/inaccessible_managed_database_list_by_managed_instance.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_inaccessible_managed_databases_by_managed_instances.py rename to sdk/sql/azure-mgmt-sql/generated_samples/inaccessible_managed_database_list_by_managed_instance.py index 46ddbba858b7..73b873dc7e23 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_inaccessible_managed_databases_by_managed_instances.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/inaccessible_managed_database_list_by_managed_instance.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_inaccessible_managed_databases_by_managed_instances.py + python inaccessible_managed_database_list_by_managed_instance.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, 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 new file mode 100644 index 000000000000..41c1b20ca3d1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_create_or_update.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 instance_failover_group_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.instance_failover_groups.begin_create_or_update( + resource_group_name="Default", + location_name="Japan East", + failover_group_name="failover-group-test-3", + parameters={ + "properties": { + "managedInstancePairs": [ + { + "partnerManagedInstanceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-secondary-mngdInstance", + "primaryManagedInstanceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-primary-mngdInstance", + } + ], + "partnerRegions": [{"location": "Japan West"}], + "readOnlyEndpoint": {"failoverPolicy": "Disabled"}, + "readWriteEndpoint": {"failoverPolicy": "Automatic", "failoverWithDataLossGracePeriodMinutes": 480}, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..af46b6ef9734 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_delete.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 instance_failover_group_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.instance_failover_groups.begin_delete( + resource_group_name="Default", + location_name="Japan East", + failover_group_name="failover-group-test-1", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..010613527e8e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_failover.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 instance_failover_group_failover.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_failover_groups.begin_failover( + resource_group_name="Default", + location_name="Japan West", + failover_group_name="failover-group-test-3", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..5dd08b0f1fc4 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_force_failover_allow_data_loss.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 instance_failover_group_force_failover_allow_data_loss.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_failover_groups.begin_force_failover_allow_data_loss( + resource_group_name="Default", + location_name="Japan West", + failover_group_name="failover-group-test-3", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..e5fd93c37001 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 instance_failover_group_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.instance_failover_groups.get( + resource_group_name="Default", + location_name="Japan East", + failover_group_name="failover-group-test", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..e204acd5ee55 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_list.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 instance_failover_group_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="00000000-1111-2222-3333-444444444444", + ) + + response = client.instance_failover_groups.list_by_location( + resource_group_name="Default", + location_name="Japan East", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_an_ipv6_firewall_rule_max/min.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_an_ipv6_firewall_rule_max/min.py rename to sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py index eeeff85f2959..0f1d5fa77024 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_an_ipv6_firewall_rule_max/min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_an_ipv6_firewall_rule_max/min.py + python ipv6_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_an_ipv6_firewall_rule.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_an_ipv6_firewall_rule.py rename to sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py index 3295f57eaad1..fdee6ffb6a56 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_an_ipv6_firewall_rule.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_an_ipv6_firewall_rule.py + python ipv6_firewall_rule_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_ipv6_firewall_rule.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_ipv6_firewall_rule.py rename to sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py index 88bb00f7a73d..ccff9a831532 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_ipv6_firewall_rule.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_ipv6_firewall_rule.py + python ipv6_firewall_rule_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_ipv6_firewall_rules.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_ipv6_firewall_rules.py rename to sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py index e49523802f69..fc6d5c05bb4f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_ipv6_firewall_rules.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_ipv6_firewall_rules.py + python ipv6_firewall_rule_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_an_ipv6_firewall_rule_max/min.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_an_ipv6_firewall_rule_max/min.py rename to sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py index d48e08e42225..618a8bbe01b5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_an_ipv6_firewall_rule_max/min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_an_ipv6_firewall_rule_max/min.py + python ipv6_firewall_rule_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/disables_uploading_ledger_digests_for_a_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_disable.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/disables_uploading_ledger_digests_for_a_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_disable.py index ac8e1628de04..b4a0f44e5654 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/disables_uploading_ledger_digests_for_a_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_disable.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python disables_uploading_ledger_digests_for_a_database.py + python ledger_digest_uploads_disable.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/enables_ledger_digest_upload_configuration_for_a_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_enable.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/enables_ledger_digest_upload_configuration_for_a_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_enable.py index 03a8d57225c7..9e041ac8f7d8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/enables_ledger_digest_upload_configuration_for_a_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_enable.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python enables_ledger_digest_upload_configuration_for_a_database.py + python ledger_digest_uploads_enable.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_ledger_digest_upload_configuration_for_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_get.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_ledger_digest_upload_configuration_for_a_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_get.py index d0d82a425c62..9ce18d9956ae 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_ledger_digest_upload_configuration_for_a_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_the_current_ledger_digest_upload_configuration_for_a_database..py + python ledger_digest_uploads_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_ledger_digest_upload_settings_on_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_list.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_ledger_digest_upload_settings_on_a_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_list.py index 04bf33f5cd89..2da2c3940395 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_ledger_digest_upload_settings_on_a_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_list_of_ledger_digest_upload_settings_on_a_database..py + python ledger_digest_uploads_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_the_user_activities_of_a_data_warehouse.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_data_warehouse_user_activities.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_of_the_user_activities_of_a_data_warehouse.py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_data_warehouse_user_activities.py index 670dd6551cac..85d3c9bf46a4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_the_user_activities_of_a_data_warehouse.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_data_warehouse_user_activities.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_of_the_user_activities_of_a_data_warehouse.py + python list_data_warehouse_user_activities.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, 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 similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_database_extensions..py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_database_extensions.py index 390a867c25aa..b5c6b76b33cb 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 @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_database_extensions..py + python list_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_database_management_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_operations.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_the_database_management_operations.py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_database_operations.py index 8147747229c0..078840b6318e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_database_management_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_operations.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_the_database_management_operations.py + python list_database_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_databases_in_an_elastic_pool..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_elastic_pool.py similarity index 92% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_databases_in_an_elastic_pool..py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_elastic_pool.py index 9c5f84c9984a..69c6a9e85c80 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_databases_in_an_elastic_pool..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_elastic_pool.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_list_of_databases_in_an_elastic_pool..py + python list_databases_by_elastic_pool.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ListDatabasesByElasticPool.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ListDatabasesByElasticPool.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_elastic_pool_management_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_operations.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_the_elastic_pool_management_operations.py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_operations.py index e4392402cdee..11205104afdd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_elastic_pool_management_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_operations.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_the_elastic_pool_management_operations.py + python list_elastic_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usages..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usages..py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage.py index 50096213eaac..42049efff7e5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usages..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_instance_pool_usages..py + python list_instance_pool_usage.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usages_expanded_with_children..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage_expanded.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usages_expanded_with_children..py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage_expanded.py index 2cecb4fc3bd4..925f2f241a5c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usages_expanded_with_children..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage_expanded.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_instance_pool_usages_expanded_with_children..py + python list_instance_pool_usage_expanded.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_in_the_subscription.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_subscription_id.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_in_the_subscription.py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_subscription_id.py index c527fbffcaf6..d522df008515 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_in_the_subscription.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_subscription_id.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_instance_pools_in_the_subscription.py + python list_instance_pools_by_subscription_id.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_in_a_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_by_server.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_in_a_server.py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_by_server.py index 8b39608834fd..068aba00fac2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_in_a_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_by_server.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_job_agents_in_a_server.py + python list_job_agents_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_credentials_in_a_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_credentials_by_agent.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_credentials_in_a_job_agent.py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_job_credentials_by_agent.py index 057cee125203..6fc02f34782c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_credentials_in_a_job_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_credentials_by_agent.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_credentials_in_a_job_agent.py + python list_job_credentials_by_agent.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_step_executions.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_steps.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_job_step_executions.py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_steps.py index 4debdafbc591..ad2f1ee0e4ee 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_step_executions.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_steps.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_job_step_executions.py + python list_job_execution_steps.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_step_target_executions.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_execution.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_job_step_target_executions.py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_execution.py index c1f6b6d53a3d..76c4316a0d29 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_step_target_executions.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_execution.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_job_step_target_executions.py + python list_job_execution_targets_by_execution.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, 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 new file mode 100644 index 000000000000..077dd593bc1e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_step.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_job_execution_targets_by_step.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_target_executions.list_by_step( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", + step_name="step1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionTargetsByStep.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_all_job_executions_in_a_job_agent..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_all_job_executions_in_a_job_agent..py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent.py index c10e63edfefa..0d898ccf63ae 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_all_job_executions_in_a_job_agent..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_all_job_executions_in_a_job_agent..py + python list_job_executions_by_agent.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_all_job_executions_in_a_job_agent_with_filtering..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent_with_filter.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_all_job_executions_in_a_job_agent_with_filtering..py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent_with_filter.py index c1db3fedd717..633d95013cf0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_all_job_executions_in_a_job_agent_with_filtering..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent_with_filter.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_all_job_executions_in_a_job_agent_with_filtering..py + python list_job_executions_by_agent_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_a_job's_executions..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_job.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_a_job's_executions..py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_job.py index 64ea935ae280..8d43c2f70c3b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_a_job's_executions..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_job.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_a_job's_executions..py + python list_job_executions_by_job.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_for_the_latest_version_of_a_job..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_job.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_for_the_latest_version_of_a_job..py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_job.py index 0b0284d8bd58..91aa98ef1197 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_for_the_latest_version_of_a_job..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_job.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_job_steps_for_the_latest_version_of_a_job..py + python list_job_steps_by_job.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_for_the_specified_version_of_a_job..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_version.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_for_the_specified_version_of_a_job..py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_version.py index 58dd643a0285..f7761109d049 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_for_the_specified_version_of_a_job..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_version.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_job_steps_for_the_specified_version_of_a_job..py + python list_job_steps_by_version.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_target_groups_in_an_agent..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_target_groups.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_all_target_groups_in_an_agent..py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_job_target_groups.py index 798801cf26a1..a1a0122c94ef 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_target_groups_in_an_agent..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_target_groups.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_all_target_groups_in_an_agent..py + python list_job_target_groups.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_versions_of_a_job..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_versions.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_all_versions_of_a_job..py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_job_versions.py index 6e206062d584..d30d32008374 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_versions_of_a_job..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_versions.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_all_versions_of_a_job..py + python list_job_versions.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_in_a_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_by_agent.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_in_a_job_agent.py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_by_agent.py index 4540cdc4f129..752e525381dc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_in_a_job_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_by_agent.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_jobs_in_a_job_agent.py + python list_jobs_by_agent.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_managed_instance_management_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_operations.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_the_managed_instance_management_operations.py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_operations.py index 6c4ffe22f4a9..f3446f9d75ec 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_managed_instance_management_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_operations.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_the_managed_instance_management_operations.py + python list_managed_instance_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_databases_by_managed_instances.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_managed_databases_by_server.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_databases_by_managed_instances.py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_managed_databases_by_server.py index 8fe2d8574789..39ccbcef1eef 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_databases_by_managed_instances.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_managed_databases_by_server.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_recoverable_databases_by_managed_instances.py + python list_recoverable_managed_databases_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_restorable_dropped_databases..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_server.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_restorable_dropped_databases..py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_server.py index 0b1eab03650c..aba91e284733 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_restorable_dropped_databases..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_server.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_list_of_restorable_dropped_databases..py + python list_restorable_dropped_databases_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server_management_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_server_operations.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_the_server_management_operations.py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_server_operations.py index 130275dcc6fc..dcf6d922189b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server_management_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_server_operations.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_the_server_management_operations.py + python list_server_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, 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 new file mode 100644 index 000000000000..15df3fdd5bdb --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_short_term_retention_policies_by_database.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) 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_short_term_retention_policies_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.backup_short_term_retention_policies.list_by_database( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListShortTermRetentionPoliciesByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_databases..py b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_databases..py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server.py index 3f4240e77045..df25e77370db 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_databases..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_list_of_databases..py + python list_vcore_databases_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, @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ListVCoreDatabasesByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/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 new file mode 100644 index 000000000000..398e9c1d61f2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_enclave_type_by_server.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_vcore_databases_enclave_type_by_server.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + 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: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ListVCoreDatabasesEnclaveTypeByServer.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_inaccessible_databases_in_a_logical_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_inaccessible_databases_by_server.py similarity index 91% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_inaccessible_databases_in_a_logical_server.py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_inaccessible_databases_by_server.py index 87ae27169896..d2179ce18012 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_inaccessible_databases_in_a_logical_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_inaccessible_databases_by_server.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_list_of_inaccessible_databases_in_a_logical_server.py + python list_vcore_inaccessible_databases_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, @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ListVCoreInaccessibleDatabasesByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ListVCoreInaccessibleDatabasesByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_subscription_capabilities_in_the_given_location..py b/sdk/sql/azure-mgmt-sql/generated_samples/location_capability_list_by_location.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_subscription_capabilities_in_the_given_location..py rename to sdk/sql/azure-mgmt-sql/generated_samples/location_capability_list_by_location.py index 14e0d1d544e0..06c607b4b823 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_subscription_capabilities_in_the_given_location..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/location_capability_list_by_location.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_subscription_capabilities_in_the_given_location..py + python location_capability_list_by_location.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/copy_the_long_term_retention_backup..py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_copy.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/copy_the_long_term_retention_backup..py rename to sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_copy.py index 8371069b38ac..3ce178f89563 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/copy_the_long_term_retention_backup..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_copy.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python copy_the_long_term_retention_backup..py + python long_term_retention_backup_copy.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_the_long_term_retention_backup..py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_the_long_term_retention_backup..py rename to sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py index 3bc89b248776..d9ff78a5b66f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_the_long_term_retention_backup..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_the_long_term_retention_backup..py + python long_term_retention_backup_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_backup..py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_backup..py rename to sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_get.py index 47e662e16794..a79f1edc9af7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_backup..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_long_term_retention_backup..py + python long_term_retention_backup_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_database.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_database.py index 3df1b3b54db7..d141a35afc39 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_all_long_term_retention_backups_under_the_database..py + python long_term_retention_backup_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_location..py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_location.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_location..py rename to sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_location.py index 80824e8c06d8..cb43db8273ce 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_location..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_location.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_all_long_term_retention_backups_under_the_location..py + python long_term_retention_backup_list_by_location.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_server..py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_server.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_server..py rename to sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_server.py index d31049eee2db..273c27d28c0a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_server..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_server.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_all_long_term_retention_backups_under_the_server..py + python long_term_retention_backup_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_long_term_retention_backup..py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_update.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_the_long_term_retention_backup..py rename to sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_update.py index 1071aaba51d4..de1bf1e63641 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_long_term_retention_backup..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_the_long_term_retention_backup..py + python long_term_retention_backup_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_the_long_term_retention_policy_for_the_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_create_or_update.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_the_long_term_retention_policy_for_the_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_create_or_update.py index e4b11fefd84e..7630f27b819d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_the_long_term_retention_policy_for_the_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_create_or_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_the_long_term_retention_policy_for_the_database..py + python long_term_retention_policy_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policy_for_the_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_get.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policy_for_the_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_get.py index 003bca2de7d0..4cf433ca2297 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policy_for_the_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_long_term_retention_policy_for_the_database..py + python long_term_retention_policy_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, 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 new file mode 100644 index 000000000000..943ff1076761 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_list_by_database.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) 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 long_term_retention_policy_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.long_term_retention_policies.list_by_database( + resource_group_name="resourceGroup", + server_name="testserver", + database_name="testDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/filter_managed_database_columns.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/filter_managed_database_columns.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_max.py index 6e1f2f95d12f..463d519330a9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/filter_managed_database_columns.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python filter_managed_database_columns.py + python managed_columns_list_by_database_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_columns.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_min.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_columns.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_min.py index b19f0ddc4ba7..519f4a75da2f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_columns.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_managed_database_columns.py + python managed_columns_list_by_database_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_database's_advanced_threat_protection_settings_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_max.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_database's_advanced_threat_protection_settings_with_all_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_max.py index fbb39a863a63..8902e446789f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_database's_advanced_threat_protection_settings_with_all_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_managed_database's_advanced_threat_protection_settings_with_all_parameters.py + python managed_database_advanced_threat_protection_settings_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_database's_advanced_threat_protection_settings_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_min.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_database's_advanced_threat_protection_settings_with_minimal_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_min.py index 008fe2ee8eaa..25156e132d98 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_database's_advanced_threat_protection_settings_with_minimal_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_managed_database's_advanced_threat_protection_settings_with_minimal_parameters.py + python managed_database_advanced_threat_protection_settings_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_database's_advanced_threat_protection_settings..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_get.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_database's_advanced_threat_protection_settings..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_get.py index c670f3d83db8..c470028291de 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_database's_advanced_threat_protection_settings..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_managed_database's_advanced_threat_protection_settings..py + python managed_database_advanced_threat_protection_settings_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_managed_database's_advanced_threat_protection_settings..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_list_by_database.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_managed_database's_advanced_threat_protection_settings..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_list_by_database.py index d12691403aa9..979cefc81963 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_managed_database's_advanced_threat_protection_settings..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_list_of_the_managed_database's_advanced_threat_protection_settings..py + python managed_database_advanced_threat_protection_settings_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancels_a_managed_database_move..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/cancels_a_managed_database_move..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py index bfc9e4fe4b6e..e0343c50b0a8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancels_a_managed_database_move..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python cancels_a_managed_database_move..py + python managed_database_cancel_move.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_column.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_column.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_get.py index aa953d66b985..c637602e7acc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_column.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_managed_database_column.py + python managed_database_column_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, 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 new file mode 100644 index 000000000000..7c205120a9da --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_list_by_table.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) 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_column_list_by_table.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_database_columns.list_by_table( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", + schema_name="dbo", + table_name="table1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnListByTable.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_or_creates_a_sensitivity_label_of_a_given_column_with_all_parameters_in_a_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_create.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/updates_or_creates_a_sensitivity_label_of_a_given_column_with_all_parameters_in_a_managed_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_create.py index 8b48d0266209..cac7da24ecba 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_or_creates_a_sensitivity_label_of_a_given_column_with_all_parameters_in_a_managed_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python updates_or_creates_a_sensitivity_label_of_a_given_column_with_all_parameters_in_a_managed_database.py + python managed_database_column_sensitivity_label_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_the_sensitivity_label_of_a_given_column_in_a_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/deletes_the_sensitivity_label_of_a_given_column_in_a_managed_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py index e44440a13271..be580835629b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_the_sensitivity_label_of_a_given_column_in_a_managed_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python deletes_the_sensitivity_label_of_a_given_column_in_a_managed_database.py + python managed_database_column_sensitivity_label_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_sensitivity_label_of_a_given_column_in_a_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_get.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_the_sensitivity_label_of_a_given_column_in_a_managed_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_get.py index 72c1ae468e18..f03ddf6c4404 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_sensitivity_label_of_a_given_column_in_a_managed_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_the_sensitivity_label_of_a_given_column_in_a_managed_database.py + python managed_database_column_sensitivity_label_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/completes_a_managed_database_external_backup_restore..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/completes_a_managed_database_external_backup_restore..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py index 8414d9e5157f..b7020b68fab4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/completes_a_managed_database_external_backup_restore..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python completes_a_managed_database_external_backup_restore..py + python managed_database_complete_external_restore.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/completes_a_managed_database_move..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/completes_a_managed_database_move..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py index cba693320c43..41dc13b8edcd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/completes_a_managed_database_move..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python completes_a_managed_database_move..py + python managed_database_complete_move.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_with_maximal_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_with_maximal_properties.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_max.py index b4191faed443..6cfa6253181d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_with_maximal_properties.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_new_managed_database_with_maximal_properties.py + python managed_database_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_with_minimal_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_min.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_with_minimal_properties.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_min.py index 6ad1def5af82..a06d94ddc813 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_with_minimal_properties.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_new_managed_database_with_minimal_properties.py + python managed_database_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_using_point_in_time_restore.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_point_in_time_restore.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_using_point_in_time_restore.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_point_in_time_restore.py index f6a3a29ab980..e6df86b7814d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_using_point_in_time_restore.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_point_in_time_restore.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_new_managed_database_using_point_in_time_restore.py + python managed_database_create_point_in_time_restore.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_from_restoring_a_georeplicated_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_recovery.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_from_restoring_a_georeplicated_backup.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_recovery.py index 19b7a51f3eee..83e63fc35cb5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_from_restoring_a_georeplicated_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_recovery.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_new_managed_database_from_restoring_a_georeplicated_backup.py + python managed_database_create_recovery.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_by_restoring_from_an_external_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_by_restoring_from_an_external_backup.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup.py index f673918f6fa1..8c4aae7e560b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_by_restoring_from_an_external_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_new_managed_database_by_restoring_from_an_external_backup.py + python managed_database_create_restore_external_backup.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_by_restoring_from_an_external_backup_using_managed_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup_managed_identity.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_by_restoring_from_an_external_backup_using_managed_identity.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup_managed_identity.py index fcac92edd8b9..0dade6849425 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_by_restoring_from_an_external_backup_using_managed_identity.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup_managed_identity.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_new_managed_database_by_restoring_from_an_external_backup_using_managed_identity.py + python managed_database_create_restore_external_backup_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_from_restoring_a_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_ltr_backup.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_from_restoring_a_long_term_retention_backup.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_ltr_backup.py index 62ff657efe27..7e6b263b0385 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_a_new_managed_database_from_restoring_a_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_ltr_backup.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_a_new_managed_database_from_restoring_a_long_term_retention_backup.py + python managed_database_create_restore_ltr_backup.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py index e065ee7443ff..d4e2787a4f0e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_managed_database.py + python managed_database_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_managed_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_get.py index d91442670876..d7c17c0b9b91 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_managed_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_managed_database.py + python managed_database_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_managed_instances.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_list_by_managed_instance.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_managed_instances.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_list_by_managed_instance.py index f08fcbb6d48c..523abc36e32f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_managed_instances.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_list_by_managed_instance.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_databases_by_managed_instances.py + python managed_database_list_by_managed_instance.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_managed_database_move_operation..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_managed_database_move_operation..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_get.py index a4836a7a9a13..b5d3aff33840 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_managed_database_move_operation..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_managed_database_move_operation..py + python managed_database_move_operation_result_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_all_managed_database_move_operations_for_specified_subscription,_resource_group_and_location..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_all_managed_database_move_operations_for_specified_subscription,_resource_group_and_location..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list.py index 6aceafb38863..84ddba0d73c1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_all_managed_database_move_operations_for_specified_subscription,_resource_group_and_location..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_all_managed_database_move_operations_for_specified_subscription,_resource_group_and_location..py + python managed_database_move_operation_result_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_last_operations.py similarity index 91% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_last_operations.py index 0518d9265981..8fcfc11cceb0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_last_operations.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location..py + python managed_database_move_operation_result_list_last_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location,_filtered_by_operation_type_.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_max.py similarity index 90% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location,_filtered_by_operation_type_.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_max.py index e84ee39f0137..2154763ffa41 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location,_filtered_by_operation_type_.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_the_latest_managed_database_move_operations_for_each_database_under_specified_subscription,_resource_group_and_location,_filtered_by_operation_type_.py + python managed_database_move_operation_result_list_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/disables_the_sensitivity_recommendations_on_a_given_column.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/disables_the_sensitivity_recommendations_on_a_given_column.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py index 9b48b7b8be64..7e0eddb653d8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/disables_the_sensitivity_recommendations_on_a_given_column.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python disables_the_sensitivity_recommendations_on_a_given_column.py + python managed_database_recommended_column_sensitivity_label_disable.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/enables_the_sensitivity_recommendations_on_a_given_column.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/enables_the_sensitivity_recommendations_on_a_given_column.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py index bb2185d9d154..91f9169d6347 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/enables_the_sensitivity_recommendations_on_a_given_column.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python enables_the_sensitivity_recommendations_on_a_given_column.py + python managed_database_recommended_column_sensitivity_label_enable.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, 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 similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/managed_database_restore_details..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_restore_details.py index b409056d61c0..8be0c2f575e5 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 @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python managed_database_restore_details..py + python managed_database_restore_details.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_schema.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_get.py index be20b00b6171..408d38bb55e5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_managed_database_schema.py + python managed_database_schema_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_schemas.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_list_by_database.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_schemas.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_list_by_database.py index 93761c9d8b62..2700a5cf5863 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_schemas.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_managed_database_schemas.py + python managed_database_schema_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, 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 new file mode 100644 index 000000000000..77aa6402b5ea --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_max.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_security_alert_create_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.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", + parameters={ + "properties": { + "disabledAlerts": ["Sql_Injection", "Usage_Anomaly"], + "emailAccountAdmins": True, + "emailAddresses": ["test@contoso.com", "user@contoso.com"], + "retentionDays": 6, + "state": "Enabled", + "storageAccountAccessKey": "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==", + "storageEndpoint": "https://mystorage.blob.core.windows.net", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..76421da784a2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_min.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) 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_security_alert_create_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.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", + parameters={"properties": {"state": "Enabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..8d52e21ef080 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_security_alert_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.managed_database_security_alert_policies.get( + resource_group_name="securityalert-6852", + managed_instance_name="securityalert-2080", + database_name="testdb", + 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 +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_threat_detection_policies..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_list_by_database.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_threat_detection_policies..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_list_by_database.py index e8bf05652726..df8ef0b51f96 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_threat_detection_policies..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_list_of_the_database's_threat_detection_policies..py + python managed_database_security_alert_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_database's_security_events_with_maximal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_max.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_database's_security_events_with_maximal_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_max.py index d68ba65a7d52..c04a72c5a5fe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_database's_security_events_with_maximal_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_managed_database's_security_events_with_maximal_parameters.py + python managed_database_security_events_get_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_database's_security_events_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_min.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_database's_security_events_with_minimal_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_min.py index 972b5c27bcbc..54147e6e57e9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_database's_security_events_with_minimal_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_managed_database's_security_events_with_minimal_parameters.py + python managed_database_security_events_get_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_sensitivity_labels_of_a_given_database_using_an_operations_batch..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_sensitivity_labels_of_a_given_database_using_an_operations_batch..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py index 2c5ef71dd8da..aaf5fd7876fb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_sensitivity_labels_of_a_given_database_using_an_operations_batch..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_sensitivity_labels_of_a_given_database_using_an_operations_batch..py + python managed_database_sensitivity_labels_current_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_sensitivity_labels_of_a_given_database_in_a_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_current.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_sensitivity_labels_of_a_given_database_in_a_managed_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_current.py index fd99915dab92..147f121a38ec 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_sensitivity_labels_of_a_given_database_in_a_managed_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_current.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_the_current_sensitivity_labels_of_a_given_database_in_a_managed_database.py + python managed_database_sensitivity_labels_list_by_database_current.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_recommended_sensitivity_labels_of_a_given_database_in_a_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_recommended.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_the_recommended_sensitivity_labels_of_a_given_database_in_a_managed_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_recommended.py index 46014687c396..95bcfd87e53c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_recommended_sensitivity_labels_of_a_given_database_in_a_managed_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_recommended.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_the_recommended_sensitivity_labels_of_a_given_database_in_a_managed_database.py + python managed_database_sensitivity_labels_list_by_database_recommended.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_recommended_sensitivity_labels_of_a_given_database_using_an_operations_batch..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_recommended_sensitivity_labels_of_a_given_database_using_an_operations_batch..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py index 69ab50b6004a..5d298ccdca88 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_recommended_sensitivity_labels_of_a_given_database_using_an_operations_batch..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_recommended_sensitivity_labels_of_a_given_database_using_an_operations_batch..py + python managed_database_sensitivity_labels_recommended_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/starts_a_managed_database_move_with_all_optional_parameters_specified..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/starts_a_managed_database_move_with_all_optional_parameters_specified..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py index 543409ece8c2..68ff235d90b3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/starts_a_managed_database_move_with_all_optional_parameters_specified..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python starts_a_managed_database_move_with_all_optional_parameters_specified..py + python managed_database_start_move_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/starts_a_managed_database_move_with_no_optional_parameters_specified..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/starts_a_managed_database_move_with_no_optional_parameters_specified..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py index 198a254b3a3a..e4185ac0f8e4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/starts_a_managed_database_move_with_no_optional_parameters_specified..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python starts_a_managed_database_move_with_no_optional_parameters_specified..py + python managed_database_start_move_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_table.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_table.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_get.py index dea0830eca7f..ff6ad300d51a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_database_table.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_managed_database_table.py + python managed_database_table_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_tables.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_list_by_schema.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_tables.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_list_by_schema.py index 2b7e4873ec8d..22cb4f7a9cfe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_database_tables.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_list_by_schema.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_managed_database_tables.py + python managed_database_table_list_by_schema.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_managed_database_with_maximal_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/updates_a_managed_database_with_maximal_properties.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_max.py index af6df3c3d8c1..e7f85f583f88 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_managed_database_with_maximal_properties.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python updates_a_managed_database_with_maximal_properties.py + python managed_database_update_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_managed_database_with_minimal_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_min.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/updates_a_managed_database_with_minimal_properties.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_min.py index 79e0fac83d46..8d743648233e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_managed_database_with_minimal_properties.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python updates_a_managed_database_with_minimal_properties.py + python managed_database_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, 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 new file mode 100644 index 000000000000..56eb5ef61597 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_max.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_vulnerability_assessment_create_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.managed_database_vulnerability_assessments.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + parameters={ + "properties": { + "recurringScans": { + "emailSubscriptionAdmins": True, + "emails": ["email1@mail.com", "email2@mail.com"], + "isEnabled": True, + }, + "storageContainerPath": "https://myStorage.blob.core.windows.net/vulnerability-assessment/", + "storageContainerSasKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentCreateMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_min.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_min.py index b265c472df43..b7af7e0fb0bb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_database's_vulnerability_assessment_with_minimal_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_database's_vulnerability_assessment_with_minimal_parameters.py + python managed_database_vulnerability_assessment_create_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, 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 new file mode 100644 index 000000000000..33be4404e456 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.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) 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_vulnerability_assessment_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_database_vulnerability_assessments.delete( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..01df21238fb2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_vulnerability_assessment_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.managed_database_vulnerability_assessments.get( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessments_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_list_by_database.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessments_list.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_list_by_database.py index 1a4e5907aa4f..43b6b024b7f3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_vulnerability_assessments_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_database's_vulnerability_assessments_list.py + python managed_database_vulnerability_assessment_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, 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 new file mode 100644 index 000000000000..e8ee07e1a814 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_create.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_vulnerability_assessment_rule_baseline_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.managed_database_vulnerability_assessment_rule_baselines.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + rule_id="VA1001", + baseline_name="default", + parameters={ + "properties": { + "baselineResults": [ + {"result": ["userA", "SELECT"]}, + {"result": ["userB", "SELECT"]}, + {"result": ["userC", "SELECT", "tableId_4"]}, + ] + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..075cb14470b5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.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) 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_vulnerability_assessment_rule_baseline_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_database_vulnerability_assessment_rule_baselines.delete( + resource_group_name="vulnerabilityaseessmenttest-4799", + managed_instance_name="vulnerabilityaseessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + rule_id="VA1001", + baseline_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..c9aae54fb5af --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_get.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) 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_vulnerability_assessment_rule_baseline_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.managed_database_vulnerability_assessment_rule_baselines.get( + resource_group_name="vulnerabilityaseessmenttest-4711", + managed_instance_name="vulnerabilityaseessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + rule_id="VA1001", + baseline_name="master", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..47a40871e64a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_export.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) 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_vulnerability_assessment_scan_export.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_database_vulnerability_assessment_scans.export( + resource_group_name="vulnerabilityassessmenttest-4799", + managed_instance_name="vulnerabilityassessmenttest-6440", + database_name="testdb", + vulnerability_assessment_name="default", + scan_id="scan001", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..c918249e0f92 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_get.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) 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_vulnerability_assessment_scan_records_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.managed_database_vulnerability_assessment_scans.get( + resource_group_name="vulnerabilityassessmenttest-4711", + managed_instance_name="vulnerabilityassessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + scan_id="scan001", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..a8091b377ec5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_list_by_database.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) 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_vulnerability_assessment_scan_records_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.managed_database_vulnerability_assessment_scans.list_by_database( + resource_group_name="vulnerabilityassessmenttest-4711", + managed_instance_name="vulnerabilityassessmenttest-6411", + database_name="testdb", + vulnerability_assessment_name="default", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..cc2ccb0a1147 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.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) 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_vulnerability_assessment_scans_execute.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_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/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScansExecute.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_administrator_of_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_create.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_administrator_of_managed_instance.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_create.py index f781195a126e..aa981e0be106 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_administrator_of_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_administrator_of_managed_instance.py + python managed_instance_administrator_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_administrator_of_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_administrator_of_managed_instance.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py index 506ba61f380c..48581ce4a599 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_administrator_of_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_administrator_of_managed_instance.py + python managed_instance_administrator_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_administrator_of_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_administrator_of_managed_instance.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_get.py index 695b942f401e..faa32ffe8665 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_administrator_of_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_administrator_of_managed_instance.py + python managed_instance_administrator_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_administrators_of_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_list_by_instance.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_administrators_of_managed_instance.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_list_by_instance.py index 67c755fe6490..b61258c1e8b0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_administrators_of_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_list_by_instance.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_administrators_of_managed_instance.py + python managed_instance_administrator_list_by_instance.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_administrator_of_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_update.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_administrator_of_managed_instance.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_update.py index 5df18e8f5eda..e41ad6a360b0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_administrator_of_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_administrator_of_managed_instance.py + python managed_instance_administrator_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_instance's_advanced_threat_protection_settings_with_all_parameters..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_max.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_instance's_advanced_threat_protection_settings_with_all_parameters..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_max.py index 1d31155cdbc5..321fdd3788ca 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_instance's_advanced_threat_protection_settings_with_all_parameters..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_managed_instance's_advanced_threat_protection_settings_with_all_parameters..py + python managed_instance_advanced_threat_protection_settings_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_instance's_advanced_threat_protection_settings_with_minimal_parameters..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_min.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_instance's_advanced_threat_protection_settings_with_minimal_parameters..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_min.py index 289fbcfd12c4..275c31b12013 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_instance's_advanced_threat_protection_settings_with_minimal_parameters..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_managed_instance's_advanced_threat_protection_settings_with_minimal_parameters..py + python managed_instance_advanced_threat_protection_settings_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_advanced_threat_protection_settings.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_get.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_advanced_threat_protection_settings.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_get.py index 32a53a957a91..49fb369db227 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_advanced_threat_protection_settings.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_managed_instance's_advanced_threat_protection_settings.py + python managed_instance_advanced_threat_protection_settings_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_managed_instance's_advanced_threat_protection_settings..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_list_by_instance.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_the_managed_instance's_advanced_threat_protection_settings..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_list_by_instance.py index e2977c8eb9bb..867a5f76c4cf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_managed_instance's_advanced_threat_protection_settings..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_list_by_instance.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_the_managed_instance's_advanced_threat_protection_settings..py + python managed_instance_advanced_threat_protection_settings_list_by_instance.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_azure_active_directory_only_authentication_object..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_create_or_update.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_azure_active_directory_only_authentication_object..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_create_or_update.py index 16e428d7f233..690bbfaff007 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_azure_active_directory_only_authentication_object..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_create_or_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_or_updates_azure_active_directory_only_authentication_object..py + python managed_instance_azure_ad_only_auth_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_azure_active_directory_only_authentication_object..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/deletes_azure_active_directory_only_authentication_object..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py index 79e8233294fe..c9a4656700be 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_azure_active_directory_only_authentication_object..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python deletes_azure_active_directory_only_authentication_object..py + python managed_instance_azure_ad_only_auth_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_azure_active_directory_only_authentication_property..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_get.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_azure_active_directory_only_authentication_property..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_get.py index 7134e81cdd1d..cc6a5e978df6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_azure_active_directory_only_authentication_property..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_azure_active_directory_only_authentication_property..py + python managed_instance_azure_ad_only_auth_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_azure_active_directory_only_authentication_object..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_list_by_instance.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_azure_active_directory_only_authentication_object..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_list_by_instance.py index 4edcf1634cc8..6474dee08898 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_azure_active_directory_only_authentication_object..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_list_by_instance.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_list_of_azure_active_directory_only_authentication_object..py + python managed_instance_azure_ad_only_auth_list_by_instance.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_instance_with_all_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_max.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_managed_instance_with_all_properties.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_max.py index 6b69791cf7e0..5605fb8e6b74 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_instance_with_all_properties.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_managed_instance_with_all_properties.py + python managed_instance_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_instance_with_minimal_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_min.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_managed_instance_with_minimal_properties.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_min.py index 24c376cc3cde..61cb60c287fd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_instance_with_minimal_properties.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_managed_instance_with_minimal_properties.py + python managed_instance_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_instance.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_delete.py index 2e825f007534..e1f680402704 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_managed_instance.py + python managed_instance_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_managed_instance_dtc_settings..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_managed_instance_dtc_settings..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_get.py index 83f2d8f8e167..fbb0d0e45c17 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_managed_instance_dtc_settings..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_managed_instance_dtc_settings..py + python managed_instance_dtc_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_managed_instance_dtc_settings..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_list.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_managed_instance_dtc_settings..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_list.py index e7f7b9768060..2475b33068ce 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_managed_instance_dtc_settings..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_list_of_managed_instance_dtc_settings..py + python managed_instance_dtc_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_managed_instance_dtc_settings_by_enabling_dtc..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_enable_dtc.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/updates_managed_instance_dtc_settings_by_enabling_dtc..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_enable_dtc.py index e0a2e76b9190..4637c61cc93b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_managed_instance_dtc_settings_by_enabling_dtc..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_enable_dtc.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python updates_managed_instance_dtc_settings_by_enabling_dtc..py + python managed_instance_dtc_update_enable_dtc.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_managed_instance_dtc_settings_with_all_optional_parameters_specified..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/updates_managed_instance_dtc_settings_with_all_optional_parameters_specified..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_max.py index 117f6370a171..8546f1030713 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_managed_instance_dtc_settings_with_all_optional_parameters_specified..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python updates_managed_instance_dtc_settings_with_all_optional_parameters_specified..py + python managed_instance_dtc_update_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, 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 new file mode 100644 index 000000000000..6badd6536128 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_key_vault.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_encryption_protector_create_or_update_key_vault.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_encryption_protectors.begin_create_or_update( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + encryption_protector_name="current", + parameters={ + "properties": { + "autoRotationEnabled": False, + "serverKeyName": "someVault_someKey_01234567890123456789012345678901", + "serverKeyType": "AzureKeyVault", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..c2215c5e1941 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_service_managed.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) 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_encryption_protector_create_or_update_service_managed.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_encryption_protectors.begin_create_or_update( + resource_group_name="sqlcrudtest-7398", + managed_instance_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/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..6350fa9a5d5f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_encryption_protector_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.managed_instance_encryption_protectors.get( + resource_group_name="sqlcrudtest-7398", + managed_instance_name="sqlcrudtest-4645", + encryption_protector_name="current", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_encryption_protectors_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_list.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_encryption_protectors_by_managed_instance.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_list.py index efa0dc704587..feb2633bf0ac 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_encryption_protectors_by_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_encryption_protectors_by_managed_instance.py + python managed_instance_encryption_protector_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, 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 new file mode 100644 index 000000000000..58ac0bfe8a91 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_encryption_protector_revalidate.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_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/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorRevalidate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get.py index 45ec8b94b56d..5a5252298f1f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_managed_instance.py + python managed_instance_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_with_$expand=administrators/activedirectory.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get_with_expand_equals_administrators.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_with_$expand=administrators/activedirectory.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get_with_expand_equals_administrators.py index 6e8ad1dcbe8e..17c325dddad2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_with_$expand=administrators/activedirectory.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_get_with_expand_equals_administrators.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_managed_instance_with_$expand=administrators/activedirectory.py + python managed_instance_get_with_expand_equals_administrators.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_managed_instance_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_create_or_update.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_managed_instance_key.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_create_or_update.py index 5bc5dd4d1d5e..22b749aa344e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_managed_instance_key.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_create_or_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_or_updates_a_managed_instance_key.py + python managed_instance_key_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_the_managed_instance_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_the_managed_instance_key.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py index 8da61248e534..00212ac55852 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_the_managed_instance_key.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_the_managed_instance_key.py + python managed_instance_key_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_instance_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_instance_key.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_get.py index af0de05a38e6..9209545ccebe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_instance_key.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_managed_instance_key.py + python managed_instance_key_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_keys_for_a_managed_instance..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_list.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_the_keys_for_a_managed_instance..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_list.py index f54c3fd95370..c2d32974e425 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_keys_for_a_managed_instance..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_the_keys_for_a_managed_instance..py + python managed_instance_key_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list.py index ac1b879b2b2d..c50f5ce77da5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_managed_instances.py + python managed_instance_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_instance_pool.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool.py index 4108f6dbe726..7cfa8dc84e40 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_instance_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_managed_instances_by_instance_pool.py + python managed_instance_list_by_instance_pool.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_instance_pool_with_$expand=administrators/activedirectory.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool_with_expand_equals_administrators.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_instance_pool_with_$expand=administrators/activedirectory.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool_with_expand_equals_administrators.py index 78241b2f06b7..1a66e87bc905 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_instance_pool_with_$expand=administrators/activedirectory.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_instance_pool_with_expand_equals_administrators.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_managed_instances_by_instance_pool_with_$expand=administrators/activedirectory.py + python managed_instance_list_by_instance_pool_with_expand_equals_administrators.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_resource_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_resource_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group.py index 929ae95b267f..48f0082fd8a1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_resource_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_managed_instances_by_resource_group.py + python managed_instance_list_by_resource_group.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_resource_group_with_$expand=administrators/activedirectory.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group_with_expand_equals_administrators.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_resource_group_with_$expand=administrators/activedirectory.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group_with_expand_equals_administrators.py index e6a61939b25d..1360a6d44cd6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_by_resource_group_with_$expand=administrators/activedirectory.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_by_resource_group_with_expand_equals_administrators.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_managed_instances_by_resource_group_with_$expand=administrators/activedirectory.py + python managed_instance_list_by_resource_group_with_expand_equals_administrators.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_with_$expand=administrators/activedirectory.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_with_expand_equals_administrators.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_with_$expand=administrators/activedirectory.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_with_expand_equals_administrators.py index 1aa34ee77fd9..0a81cbaae679 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instances_with_$expand=administrators/activedirectory.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_list_with_expand_equals_administrators.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_managed_instances_with_$expand=administrators/activedirectory.py + python managed_instance_list_with_expand_equals_administrators.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, 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 new file mode 100644 index 000000000000..31f8f5e4e66c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.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) 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_backup_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.long_term_retention_managed_instance_backups.begin_delete( + location_name="japaneast", + managed_instance_name="testInstance", + database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_backup_of_a_managed_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_get.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_backup_of_a_managed_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_get.py index 99ef829e21aa..d5221425b6b7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_backup_of_a_managed_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_long_term_retention_backup_of_a_managed_database..py + python managed_instance_long_term_retention_backup_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, 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 new file mode 100644 index 000000000000..431e6db4ec91 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_database.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) 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_backup_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.long_term_retention_managed_instance_backups.list_by_database( + location_name="japaneast", + managed_instance_name="testInstance", + database_name="testDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_managed_instance..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_instance.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_managed_instance..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_instance.py index b2c668efdc18..4413c8444018 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_all_long_term_retention_backups_under_the_managed_instance..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_instance.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_all_long_term_retention_backups_under_the_managed_instance..py + python managed_instance_long_term_retention_backup_list_by_instance.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, 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 new file mode 100644 index 000000000000..ba7c01d3b31a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_backup_list_by_location.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_location( + location_name="japaneast", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByLocation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_the_ltr_policy_for_the_managed_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_create_or_update.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_the_ltr_policy_for_the_managed_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_create_or_update.py index efedcfbcedf1..2c4f1258d95a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_the_ltr_policy_for_the_managed_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_create_or_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_the_ltr_policy_for_the_managed_database..py + python managed_instance_long_term_retention_policy_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policy_for_the_managed_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_get.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policy_for_the_managed_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_get.py index 0f7568ba01f9..ca162da49d28 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policy_for_the_managed_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_long_term_retention_policy_for_the_managed_database..py + python managed_instance_long_term_retention_policy_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policies_for_the_managed_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_list_by_database.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policies_for_the_managed_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_list_by_database.py index c4ee777bd1f7..e12106e9ef37 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_long_term_retention_policies_for_the_managed_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_long_term_retention_policies_for_the_managed_database..py + python managed_instance_long_term_retention_policy_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_private_endpoint_connection_with_a_given_name..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_private_endpoint_connection_with_a_given_name..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py index 6d9ad1c47771..f2b69934688e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_private_endpoint_connection_with_a_given_name..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python deletes_a_private_endpoint_connection_with_a_given_name..py + python managed_instance_private_endpoint_connection_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_private_endpoint_connection..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_private_endpoint_connection..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_get.py index 3e751c3df2bb..cd1f4c4ed109 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_private_endpoint_connection..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_private_endpoint_connection..py + python managed_instance_private_endpoint_connection_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_private_endpoint_connections_on_a_server..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_list.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_private_endpoint_connections_on_a_server..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_list.py index a700bee1a7cc..020344fabf39 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_private_endpoint_connections_on_a_server..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_list_of_private_endpoint_connections_on_a_server..py + python managed_instance_private_endpoint_connection_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/approve_or_reject_a_private_endpoint_connection_with_a_given_name..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_update.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/approve_or_reject_a_private_endpoint_connection_with_a_given_name..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_update.py index 4e2474a2fb8c..75b64727e82e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/approve_or_reject_a_private_endpoint_connection_with_a_given_name..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python approve_or_reject_a_private_endpoint_connection_with_a_given_name..py + python managed_instance_private_endpoint_connection_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_private_link_resource_for_sql..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_private_link_resource_for_sql..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_get.py index 8a3c127030bf..3116d6dc76e5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_private_link_resource_for_sql..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_private_link_resource_for_sql..py + python managed_instance_private_link_resources_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_private_link_resources_for_sql..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_list.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_private_link_resources_for_sql..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_list.py index 1a2b08e4368f..36a27f4fc155 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_private_link_resources_for_sql..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_private_link_resources_for_sql..py + python managed_instance_private_link_resources_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_properties.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_get.py index 6c5ec0f74bef..b870a911d95c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_properties.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python obtain_query_properties.py + python managed_instance_query_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list.py index 80e6dd6ff6f0..df30a622451d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python obtain_query_execution_statistics.py + python managed_instance_query_statistics_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics._example_with_all_request_parameters..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_max.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics._example_with_all_request_parameters..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_max.py index 36e6117737b1..68f586d8cb95 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics._example_with_all_request_parameters..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python obtain_query_execution_statistics._example_with_all_request_parameters..py + python managed_instance_query_statistics_list_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics._minimal_example_with_only_mandatory_request_parameters..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_min.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics._minimal_example_with_only_mandatory_request_parameters..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_min.py index b3daccd0c5b5..43c6ffab58ed 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_query_execution_statistics._minimal_example_with_only_mandatory_request_parameters..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python obtain_query_execution_statistics._minimal_example_with_only_mandatory_request_parameters..py + python managed_instance_query_statistics_list_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/remove_maintenance_policy_from_managed_instance_(select_default_maintenance_policy).py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_remove_maintenance_configuration.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/remove_maintenance_policy_from_managed_instance_(select_default_maintenance_policy).py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_remove_maintenance_configuration.py index acc7123ce646..55018e729a9a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/remove_maintenance_policy_from_managed_instance_(select_default_maintenance_policy).py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_remove_maintenance_configuration.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python remove_maintenance_policy_from_managed_instance_(select_default_maintenance_policy).py + python managed_instance_remove_maintenance_configuration.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/upload_a_tde_certificate.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/upload_a_tde_certificate.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py index 3cb4a052ee73..33f0d11ae0c4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/upload_a_tde_certificate.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python upload_a_tde_certificate.py + python managed_instance_tde_certificate.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_time_zone.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_time_zone.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_get.py index 4a9829e5c7f6..44db1246f413 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_time_zone.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_managed_instance_time_zone.py + python managed_instance_time_zone_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_time_zones_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_list_by_location.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_time_zones_by_location.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_list_by_location.py index ab308415353d..768e4db45fb0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_time_zones_by_location.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_list_by_location.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_managed_instance_time_zones_by_location.py + python managed_instance_time_zone_list_by_location.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list.py index e86449f3715d..5d45b8bdc2bf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python obtain_list_of_instance's_top_resource_consuming_queries..py + python managed_instance_top_queries_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries._fullblown_request_and_response..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_max.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries._fullblown_request_and_response..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_max.py index 733ead4b4abc..e2ad638ed9a8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries._fullblown_request_and_response..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python obtain_list_of_instance's_top_resource_consuming_queries._fullblown_request_and_response..py + python managed_instance_top_queries_list_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries._minimal_request_and_response..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_min.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries._minimal_request_and_response..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_min.py index 11b5d9cfeeab..5513025b7386 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/obtain_list_of_instance's_top_resource_consuming_queries._minimal_request_and_response..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_top_queries_list_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python obtain_list_of_instance's_top_resource_consuming_queries._minimal_request_and_response..py + python managed_instance_top_queries_list_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_instance_with_all_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_max.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_managed_instance_with_all_properties.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_max.py index b52d449ecdc0..236fef388cd2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_instance_with_all_properties.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_managed_instance_with_all_properties.py + python managed_instance_update_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_instance_with_minimal_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_min.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_managed_instance_with_minimal_properties.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_min.py index 401ff41d7a97..a310e6ea7654 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_instance_with_minimal_properties.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_update_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_managed_instance_with_minimal_properties.py + python managed_instance_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_container_sas_key_min.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_container_sas_key_min.py index c255bb8cfff6..b39d923ba372 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_container_sas_key_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py + python managed_instance_vulnerability_assessment_create_container_sas_key_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_all_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_max.py index fd118bc65549..e31e7ddd2814 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_all_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_managed_instance's_vulnerability_assessment_with_all_parameters.py + python managed_instance_vulnerability_assessment_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_storage_access_key_min.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_storage_access_key_min.py index 41637d26ee30..7549d810eff0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_storage_access_key_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_managed_instance's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py + python managed_instance_vulnerability_assessment_create_storage_access_key_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/remove_a_managed_instance's_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/remove_a_managed_instance's_vulnerability_assessment.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py index 9c2d2a01b7ea..0bd29afdeec7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/remove_a_managed_instance's_vulnerability_assessment.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python remove_a_managed_instance's_vulnerability_assessment.py + python managed_instance_vulnerability_assessment_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_vulnerability_assessment.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_get.py index ea9ecf43c1ca..7ef1dfc3b97a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_vulnerability_assessment.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_managed_instance's_vulnerability_assessment.py + python managed_instance_vulnerability_assessment_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_vulnerability_assessment_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_list_by_instance.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_vulnerability_assessment_policies.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_list_by_instance.py index d392d643f40e..ef52c120c721 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_instance's_vulnerability_assessment_policies.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_list_by_instance.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_managed_instance's_vulnerability_assessment_policies.py + python managed_instance_vulnerability_assessment_list_by_instance.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/acquire_managed_server_dns_alias..py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_acquire.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/acquire_managed_server_dns_alias..py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_acquire.py index 15bf29bafe8f..eeb3fc5dd675 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/acquire_managed_server_dns_alias..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_acquire.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python acquire_managed_server_dns_alias..py + python managed_server_dns_alias_acquire.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_server_dns_alias.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_server_dns_alias.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py index a053d9841c3f..67151e54722c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_managed_server_dns_alias.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_managed_server_dns_alias.py + python managed_server_dns_alias_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_server_dns_alias.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_managed_server_dns_alias.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_get.py index 6e7bac4c8e1d..3fad1ed7d039 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_server_dns_alias.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_managed_server_dns_alias.py + python managed_server_dns_alias_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_server_dns_aliases.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_managed_server_dns_aliases.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_list.py index e55c3159c722..3194c3187813 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_server_dns_aliases.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_managed_server_dns_aliases.py + python managed_server_dns_alias_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_server's_threat_detection_policy_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_server's_threat_detection_policy_with_all_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_max.py index fcf961ea5268..43ec17281379 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_server's_threat_detection_policy_with_all_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_managed_server's_threat_detection_policy_with_all_parameters.py + python managed_server_security_alert_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_server's_threat_detection_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_min.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_server's_threat_detection_policy_with_minimal_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_min.py index 0c4fd651770e..ca23c3085148 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_managed_server's_threat_detection_policy_with_minimal_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_managed_server's_threat_detection_policy_with_minimal_parameters.py + python managed_server_security_alert_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_server's_threat_detection_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_server's_threat_detection_policy.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_get.py index adbfeff47200..a58cdb86721c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_managed_server's_threat_detection_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_managed_server's_threat_detection_policy.py + python managed_server_security_alert_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_server's_threat_detection_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_list_by_instance.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_server's_threat_detection_policies.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_list_by_instance.py index 430967979785..fe102b893551 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_managed_server's_threat_detection_policies.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_list_by_instance.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_managed_server's_threat_detection_policies.py + python managed_server_security_alert_list_by_instance.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_transparent_data_encryption.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_transparent_data_encryption.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_get.py index 0516401d5226..be16b3a27a75 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_database's_transparent_data_encryption.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_database's_transparent_data_encryption.py + python managed_transparent_data_encryption_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_transparent_data_encryptions.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_list.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_transparent_data_encryptions.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_list.py index 858357875d6e..6a9e78ae1bd8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_transparent_data_encryptions.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_list_of_the_database's_transparent_data_encryptions.py + python managed_transparent_data_encryption_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_transparent_data_encryption_state_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_update.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_transparent_data_encryption_state_with_minimal_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_update.py index 68c3859a8191..29d8e871e224 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_database's_transparent_data_encryption_state_with_minimal_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_database's_transparent_data_encryption_state_with_minimal_parameters.py + python managed_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_outbound_firewall_rule_with_a_given_name..py b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_outbound_firewall_rule_with_a_given_name..py rename to sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py index 9f1b5d636b5f..580f103275a5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deletes_a_outbound_firewall_rule_with_a_given_name..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python deletes_a_outbound_firewall_rule_with_a_given_name..py + python outbound_firewall_rule_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_outbound_firewall_rule..py b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_outbound_firewall_rule..py rename to sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_get.py index a40d346268fe..5d6aafe2ea61 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_outbound_firewall_rule..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_outbound_firewall_rule..py + python outbound_firewall_rule_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_outbound_firewall_rules_on_a_server..py b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_list.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_outbound_firewall_rules_on_a_server..py rename to sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_list.py index f13a8c0a5f45..6e5274410b84 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_list_of_outbound_firewall_rules_on_a_server..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_list_of_outbound_firewall_rules_on_a_server..py + python outbound_firewall_rule_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, 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 new file mode 100644 index 000000000000..e1458f65ed2b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_default_enclave.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) 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 patch_database_default_enclave.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_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={"properties": {"preferredEnclaveType": "Default"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/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 new file mode 100644 index 000000000000..d57219dfd6d8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_vbs_enclave.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) 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 patch_database_vbs_enclave.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_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={"properties": {"preferredEnclaveType": "VBS"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/PatchDatabaseVBSEnclave.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_an_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_instance_pool.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/patch_an_instance_pool.py rename to sdk/sql/azure-mgmt-sql/generated_samples/patch_instance_pool.py index 1f9448796afe..856593c9ffec 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/patch_an_instance_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_instance_pool.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python patch_an_instance_pool.py + python patch_instance_pool.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/updates_a_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database.py index cfc545ba51f9..d13cf6e236b5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python updates_a_database..py + python patch_vcore_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, @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/PatchVCoreDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/PatchVCoreDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/assigns_maintenance_window_to_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_assign_maintenance_configuration.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/assigns_maintenance_window_to_a_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_assign_maintenance_configuration.py index f61dd2395c34..5cf255aa8790 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/assigns_maintenance_window_to_a_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_assign_maintenance_configuration.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python assigns_maintenance_window_to_a_database..py + python patch_vcore_database_assign_maintenance_configuration.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, @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/PatchVCoreDatabaseAssignMaintenanceConfiguration.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/PatchVCoreDatabaseAssignMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resets_maintenance_window_of_a_database_to_default..py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_reset_maintenance_configuration.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/resets_maintenance_window_of_a_database_to_default..py rename to sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_reset_maintenance_configuration.py index 270ba5f811d8..9dfc4bc24738 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resets_maintenance_window_of_a_database_to_default..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_reset_maintenance_configuration.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python resets_maintenance_window_of_a_database_to_default..py + python patch_vcore_database_reset_maintenance_configuration.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, @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/PatchVCoreDatabaseResetMaintenanceConfiguration.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/PatchVCoreDatabaseResetMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/pauses_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/pause_database.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/pauses_a_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/pause_database.py index 6c463046719a..fd25770a390e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/pauses_a_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/pause_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python pauses_a_database..py + python pause_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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/PauseDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/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 new file mode 100644 index 000000000000..3917f9646351 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_delete.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 private_endpoint_connection_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.private_endpoint_connections.begin_delete( + resource_group_name="Default", + server_name="test-svr", + private_endpoint_connection_name="private-endpoint-connection-name", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..bb4cce4cc496 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 private_endpoint_connection_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.private_endpoint_connections.get( + resource_group_name="Default", + server_name="test-svr", + private_endpoint_connection_name="private-endpoint-connection-name", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..b0d9735dc51e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_list.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 private_endpoint_connection_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="00000000-1111-2222-3333-444444444444", + ) + + response = client.private_endpoint_connections.list_by_server( + resource_group_name="Default", + server_name="test-svr", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..d6e27e2c6a88 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_update.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 private_endpoint_connection_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.private_endpoint_connections.begin_create_or_update( + resource_group_name="Default", + server_name="test-svr", + private_endpoint_connection_name="private-endpoint-connection-name", + parameters={ + "properties": { + "privateLinkServiceConnectionState": { + "description": "Approved by johndoe@contoso.com", + "status": "Approved", + } + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..b8d8643db3ab --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_get.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 private_link_resources_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.private_link_resources.get( + resource_group_name="Default", + server_name="test-svr", + group_name="plr", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..24335380ab56 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_list.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 private_link_resources_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="00000000-1111-2222-3333-444444444444", + ) + + response = client.private_link_resources.list_by_server( + resource_group_name="Default", + server_name="test-svr", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateLinkResourcesList.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/disables_sensitivity_recommendations_on_a_given_column.py b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/disables_sensitivity_recommendations_on_a_given_column.py rename to sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py index a43c53869b48..c2b07f780886 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/disables_sensitivity_recommendations_on_a_given_column.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python disables_sensitivity_recommendations_on_a_given_column.py + python recommended_column_sensitivity_label_disable.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/enables_sensitivity_recommendations_on_a_given_column.py b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/enables_sensitivity_recommendations_on_a_given_column.py rename to sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py index 105f99152280..d59975a15795 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/enables_sensitivity_recommendations_on_a_given_column.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python enables_sensitivity_recommendations_on_a_given_column.py + python recommended_column_sensitivity_label_enable.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_recoverable_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_recoverable_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get.py index c2ae026834a0..fb58435add85 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_recoverable_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_recoverable_database.py + python recoverable_database_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_list_of_restorable_dropped_databases.py b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_list.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_list_of_restorable_dropped_databases.py rename to sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_list.py index 44c3f13ce0a6..5185a6bd85ab 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_list_of_restorable_dropped_databases.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_list_of_restorable_dropped_databases.py + python recoverable_database_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/renames_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/renames_a_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py index 70c647f7ec71..585af8c56f22 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/renames_a_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python renames_a_database..py + python rename_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, @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/RenameDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/RenameDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_replication_link_on_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_replication_link_on_server.py rename to sdk/sql/azure-mgmt-sql/generated_samples/replication_link_delete.py index 8ff6aeeef2d7..e1f10e6072dc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_replication_link_on_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_replication_link_on_server.py + python replication_link_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/planned_failover_of_a_replication_link.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/planned_failover_of_a_replication_link.py rename to sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover.py index 131295b30cef..8d643bad349b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/planned_failover_of_a_replication_link.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python planned_failover_of_a_replication_link.py + python replication_link_failover.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/forced_failover_of_a_replication_link.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover_allow_data_loss.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/forced_failover_of_a_replication_link.py rename to sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover_allow_data_loss.py index dc790a4c861c..eb50621580ae 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/forced_failover_of_a_replication_link.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_failover_allow_data_loss.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python forced_failover_of_a_replication_link.py + python replication_link_failover_allow_data_loss.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_replication_link..py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_the_replication_link..py rename to sdk/sql/azure-mgmt-sql/generated_samples/replication_link_get.py index abddcf3e02f7..5060806ba784 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_replication_link..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_the_replication_link..py + python replication_link_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_replication_links_on_server_on_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_database.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_replication_links_on_server_on_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_database.py index bb61e368c49d..618498b71c16 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_replication_links_on_server_on_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_replication_links_on_server_on_database..py + python replication_link_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_replication_links_on_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_server.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_replication_links_on_server.py rename to sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_server.py index 72347d02ca9c..09882b8834fd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_replication_links_on_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_list_by_server.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_replication_links_on_server.py + python replication_link_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, 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 new file mode 100644 index 000000000000..cfd3b915770e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_copy.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_long_term_retention_backup_copy.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_backups.begin_copy_by_resource_group( + resource_group_name="testResourceGroup", + location_name="japaneast", + long_term_retention_server_name="testserver", + long_term_retention_database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + parameters={ + "properties": { + "targetBackupStorageRedundancy": "Geo", + "targetDatabaseName": "testDatabase2", + "targetServerResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver2", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/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 new file mode 100644 index 000000000000..983e2e17ee62 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.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) 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_long_term_retention_backup_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.long_term_retention_backups.begin_delete_by_resource_group( + resource_group_name="testResourceGroup", + location_name="japaneast", + long_term_retention_server_name="testserver", + long_term_retention_database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/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 new file mode 100644 index 000000000000..b2457e4b29a6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_get.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) 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_long_term_retention_backup_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.long_term_retention_backups.get_by_resource_group( + resource_group_name="testResourceGroup", + location_name="japaneast", + long_term_retention_server_name="testserver", + long_term_retention_database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/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 new file mode 100644 index 000000000000..b3f2277cb22d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_database.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) 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_long_term_retention_backup_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.long_term_retention_backups.list_by_resource_group_database( + resource_group_name="testResourceGroup", + location_name="japaneast", + long_term_retention_server_name="testserver", + long_term_retention_database_name="testDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/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 new file mode 100644 index 000000000000..34bb47745d2d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_location.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_long_term_retention_backup_list_by_location.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_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/preview/2021-05-01-preview/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 new file mode 100644 index 000000000000..b4245488a95c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_server.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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_long_term_retention_backup_list_by_server.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.long_term_retention_backups.list_by_resource_group_server( + resource_group_name="testResourceGroup", + location_name="japaneast", + long_term_retention_server_name="testserver", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/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 new file mode 100644 index 000000000000..1d299567f1ca --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_update.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) 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_long_term_retention_backup_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.long_term_retention_backups.begin_update_by_resource_group( + resource_group_name="testResourceGroup", + location_name="japaneast", + long_term_retention_server_name="testserver", + long_term_retention_database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + parameters={"properties": {"requestedBackupStorageRedundancy": "Geo"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/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 new file mode 100644 index 000000000000..2eb361811a3b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.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) 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_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.long_term_retention_managed_instance_backups.begin_delete_by_resource_group( + resource_group_name="testResourceGroup", + location_name="japaneast", + managed_instance_name="testInstance", + database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/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 new file mode 100644 index 000000000000..1133a80ac462 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_get.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) 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_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.long_term_retention_managed_instance_backups.get_by_resource_group( + resource_group_name="testResourceGroup", + location_name="japaneast", + managed_instance_name="testInstance", + database_name="testDatabase", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/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 new file mode 100644 index 000000000000..629de1d05396 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_database.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) 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_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.long_term_retention_managed_instance_backups.list_by_resource_group_database( + resource_group_name="testResourceGroup", + location_name="japaneast", + managed_instance_name="testInstance", + database_name="testDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/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 new file mode 100644 index 000000000000..208b00843521 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_instance.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) 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_instance.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_instance( + resource_group_name="testResourceGroup", + location_name="japaneast", + managed_instance_name="testInstance", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/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 new file mode 100644 index 000000000000..2045aa8431d1 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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.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/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByLocation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_managed_instances.py b/sdk/sql/azure-mgmt-sql/generated_samples/restorable_dropped_managed_database_list_by_managed_instance.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_managed_instances.py rename to sdk/sql/azure-mgmt-sql/generated_samples/restorable_dropped_managed_database_list_by_managed_instance.py index f05bb9a0fb1b..469ffe52f556 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_managed_instances.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/restorable_dropped_managed_database_list_by_managed_instance.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_restorable_dropped_databases_by_managed_instances.py + python restorable_dropped_managed_database_list_by_managed_instance.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resumes_a_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/resume_database.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/resumes_a_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/resume_database.py index 7aea4f406c8e..8fb84fb0ccf9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resumes_a_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resume_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python resumes_a_database..py + python resume_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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ResumeDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ResumeDatabase.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 new file mode 100644 index 000000000000..b92df352c987 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_current_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.sensitivity_labels.update( + resource_group_name="myRG", + server_name="myServer", + database_name="myDatabase", + parameters={ + "operations": [ + { + "properties": { + "column": "column1", + "op": "set", + "schema": "dbo", + "sensitivityLabel": { + "properties": { + "informationType": "Financial", + "informationTypeId": "1D3652D6-422C-4115-82F1-65DAEBC665C8", + "labelId": "3A477B16-9423-432B-AA97-6069B481CEC3", + "labelName": "Highly Confidential", + "rank": "Low", + } + }, + "table": "table1", + } + }, + { + "properties": { + "column": "column2", + "op": "set", + "schema": "dbo", + "sensitivityLabel": { + "properties": { + "informationType": "PhoneNumber", + "informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646", + "labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff", + "labelName": "PII", + "rank": "Critical", + } + }, + "table": "table2", + } + }, + {"properties": {"column": "Column3", "op": "remove", "schema": "dbo", "table": "Table1"}}, + ] + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsCurrentUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_sensitivity_labels_of_a_given_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_current.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_sensitivity_labels_of_a_given_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_current.py index f3d1d20ba526..2c856a12ecba 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_current_sensitivity_labels_of_a_given_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_current.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_the_current_sensitivity_labels_of_a_given_database.py + python sensitivity_labels_list_by_database_with_source_current.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_recommended_sensitivity_labels_of_a_given_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_recommended.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_the_recommended_sensitivity_labels_of_a_given_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_recommended.py index 1f8e9ce4e0e2..533b083be45b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_recommended_sensitivity_labels_of_a_given_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_recommended.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_the_recommended_sensitivity_labels_of_a_given_database.py + python sensitivity_labels_list_by_database_with_source_recommended.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, 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 new file mode 100644 index 000000000000..87f9c2344418 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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_recommended_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.recommended_sensitivity_labels.update( + resource_group_name="myRG", + server_name="myServer", + database_name="myDatabase", + parameters={ + "operations": [ + {"properties": {"column": "column1", "op": "enable", "schema": "dbo", "table": "table1"}}, + {"properties": {"column": "column2", "op": "enable", "schema": "dbo", "table": "table2"}}, + {"properties": {"column": "column3", "op": "disable", "schema": "dbo", "table": "table1"}}, + ] + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsRecommendedUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_advanced_threat_protection_settings_with_all_parameters..py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_max.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_advanced_threat_protection_settings_with_all_parameters..py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_max.py index 093fdc495877..44aa3bd1058f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_advanced_threat_protection_settings_with_all_parameters..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_server's_advanced_threat_protection_settings_with_all_parameters..py + python server_advanced_threat_protection_settings_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_advanced_threat_protection_settings_with_minimal_parameters..py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_min.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_advanced_threat_protection_settings_with_minimal_parameters..py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_min.py index 66a462e140e8..6c0235f2a980 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_advanced_threat_protection_settings_with_minimal_parameters..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_server's_advanced_threat_protection_settings_with_minimal_parameters..py + python server_advanced_threat_protection_settings_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_advanced_threat_protection_settings.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_advanced_threat_protection_settings.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_get.py index 20e37a40c4a4..2df5b6a5f917 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_advanced_threat_protection_settings.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_server's_advanced_threat_protection_settings.py + python server_advanced_threat_protection_settings_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server's_advanced_threat_protection_settings..py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_list_by_server.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_the_server's_advanced_threat_protection_settings..py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_list_by_server.py index 4692fd3c4ba2..045bdb532b67 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server's_advanced_threat_protection_settings..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_list_by_server.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_the_server's_advanced_threat_protection_settings..py + python server_advanced_threat_protection_settings_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_server_advisor.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_server_advisor.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_get.py index 1f4acec8c77c..fb77969f4bc9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_server_advisor.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_server_advisor.py + python server_advisor_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_server_advisors.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_of_server_advisors.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_list.py index 6b4188a68682..af876baf5f9c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_server_advisors.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_of_server_advisors.py + python server_advisor_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_server_advisor.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_update.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_server_advisor.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_update.py index 6085e984c782..f242f587472d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_server_advisor.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_server_advisor.py + python server_advisor_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_auditing_settings_of_a_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_auditing_settings_list.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_auditing_settings_of_a_server.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_auditing_settings_list.py index d5963e4fcd92..76d255fc5ea0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_auditing_settings_of_a_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_auditing_settings_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_auditing_settings_of_a_server.py + python server_auditing_settings_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_automatic_tuning_settings.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_automatic_tuning_settings.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_get.py index 5547f06db638..2d3a423ce7c8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_automatic_tuning_settings.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_server's_automatic_tuning_settings.py + python server_automatic_tuning_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_server_automatic_tuning_settings_with_all_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/updates_server_automatic_tuning_settings_with_all_properties.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_max.py index 0387425cf8b5..f3ae312ad718 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_server_automatic_tuning_settings_with_all_properties.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python updates_server_automatic_tuning_settings_with_all_properties.py + python server_automatic_tuning_update_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_server_automatic_tuning_settings_with_minimal_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_min.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/updates_server_automatic_tuning_settings_with_minimal_properties.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_min.py index 6bcc30180e07..866ff21c70e7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_server_automatic_tuning_settings_with_minimal_properties.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python updates_server_automatic_tuning_settings_with_minimal_properties.py + python server_automatic_tuning_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_blob_auditing_policy_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_max.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_blob_auditing_policy_with_all_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_max.py index 4964a98d5e1c..a5166688c9b8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_blob_auditing_policy_with_all_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_server's_blob_auditing_policy_with_all_parameters.py + python server_blob_auditing_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_blob_auditing_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_min.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_blob_auditing_policy_with_minimal_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_min.py index d4b98cda40a1..932fbb9892c6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_blob_auditing_policy_with_minimal_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_server's_blob_auditing_policy_with_minimal_parameters.py + python server_blob_auditing_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_blob_auditing_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_blob_auditing_policy.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_get.py index 6da3931a1707..53afba713545 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_blob_auditing_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_server's_blob_auditing_policy.py + python server_blob_auditing_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server_communication_link.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_create_or_update.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_server_communication_link.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_create_or_update.py index cff1294e7d89..49c2103c897d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server_communication_link.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_create_or_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_server_communication_link.py + python server_communication_link_create_or_update.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_server_communication_link.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_delete.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_a_server_communication_link.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_delete.py index 966a52095d7f..97cc14bf612d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_server_communication_link.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_a_server_communication_link.py + python server_communication_link_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server_communication_link.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_server_communication_link.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_get.py index ecb55dd26d97..6911134744c6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server_communication_link.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_server_communication_link.py + python server_communication_link_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_communication_links.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_server_communication_links.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_list.py index 929767701801..81af264484b1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_communication_links.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_server_communication_links.py + python server_communication_link_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_server_connection_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_server_connection_policy.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_get.py index 3f31253c7af7..05d1d8fedada 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_server_connection_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_server_connection_policy.py + python server_connection_policies_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/lists_a_servers_connection_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_list.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/lists_a_servers_connection_policies.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_list.py index e4adbdf79e76..1eee82775806 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/lists_a_servers_connection_policies.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python lists_a_servers_connection_policies.py + python server_connection_policies_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_server_connection_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_update.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/updates_a_server_connection_policy.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_update.py index 87b389281b97..40a94c8903c8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/updates_a_server_connection_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python updates_a_server_connection_policy.py + python server_connection_policies_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_create.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_server.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_create.py index 148c2848b12b..72806f5310cd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_server.py + python server_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_server.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py index e7d5c65af410..55adb0acde2a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_server.py + python server_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_dev_ops_audit_settings_with_all_params.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_dev_ops_audit_settings_with_all_params.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_max.py index d7238784fd7a..756471367bf4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_dev_ops_audit_settings_with_all_params.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_server's_dev_ops_audit_settings_with_all_params.py + python server_dev_ops_audit_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_dev_ops_audit_settings_with_minimal_input.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_min.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_dev_ops_audit_settings_with_minimal_input.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_min.py index cec15fcfaf58..c23d4053d4ee 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_dev_ops_audit_settings_with_minimal_input.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_server's_dev_ops_audit_settings_with_minimal_input.py + python server_dev_ops_audit_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_dev_ops_audit_settings.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_dev_ops_audit_settings.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_get.py index 289895c9d490..2530b8f26a08 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_dev_ops_audit_settings.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_server's_dev_ops_audit_settings.py + python server_dev_ops_audit_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_dev_ops_audit_settings_of_a_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_list.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_dev_ops_audit_settings_of_a_server.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_list.py index 1b4d955a4c3a..f69d056281df 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_dev_ops_audit_settings_of_a_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_dev_ops_audit_settings_of_a_server.py + python server_dev_ops_audit_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/acquire_server_dns_alias.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_acquire.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/acquire_server_dns_alias.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_acquire.py index 77ffce668fe7..b9250a6a3fbd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/acquire_server_dns_alias.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_acquire.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python acquire_server_dns_alias.py + python server_dns_alias_acquire.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_server_dns_alias.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_create_or_update.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_server_dns_alias.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_create_or_update.py index e30463a2af5c..da0092256d68 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_server_dns_alias.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_create_or_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_server_dns_alias.py + python 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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_server_dns_alias.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_server_dns_alias.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py index 9115a14ee3f1..80a6c94a1304 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_server_dns_alias.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_server_dns_alias.py + python server_dns_alias_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_server_dns_alias.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_server_dns_alias.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_get.py index 8518bd317273..e395046e5115 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_server_dns_alias.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_server_dns_alias.py + python server_dns_alias_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_dns_aliases.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_server_dns_aliases.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_list.py index ce6e442f16d6..ea3eb7e9d274 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_dns_aliases.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_server_dns_aliases.py + python server_dns_alias_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_extended_auditing_settings_of_a_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_extended_auditing_settings_list.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_extended_auditing_settings_of_a_server.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_extended_auditing_settings_list.py index 30155fac5f70..fe888366408e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_extended_auditing_settings_of_a_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_extended_auditing_settings_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_extended_auditing_settings_of_a_server.py + python server_extended_auditing_settings_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_get.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_server.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_get.py index 2f0e5b0e9525..1f11d02516fb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_server.py + python server_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_server_with_$expand=administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_get_with_expand_equals_administrators.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_server_with_$expand=administrators.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_get_with_expand_equals_administrators.py index 3091ee94af6c..d77c905e12be 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_server_with_$expand=administrators.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_get_with_expand_equals_administrators.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_server_with_$expand=administrators.py + python server_get_with_expand_equals_administrators.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_server_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_server_key.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update.py index 6236be5409c9..f37e45cf854f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/creates_or_updates_a_server_key.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python creates_or_updates_a_server_key.py + python server_key_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_the_server_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_the_server_key.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py index e5123ed013bd..977824130c2f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_the_server_key.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_the_server_key.py + python server_key_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_server_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_the_server_key.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_key_get.py index f8e0ee932976..bfb6ce03fdc5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_the_server_key.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_the_server_key.py + python server_key_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server_keys_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_the_server_keys_by_server.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_key_list.py index e3b2330a68e5..4f51e7df04a1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server_keys_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_the_server_keys_by_server.py + python server_key_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_list.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_servers.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_list.py index cceb60af8e97..c5bf00eff6f1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_servers.py + python server_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_by_resource_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_servers_by_resource_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group.py index 16a29225774a..ed00c6144493 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_by_resource_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_servers_by_resource_group.py + python server_list_by_resource_group.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_by_resource_group_with_$expand=administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group_with_expand_equals_administrators.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_servers_by_resource_group_with_$expand=administrators.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group_with_expand_equals_administrators.py index 854015e9bf9b..de3ca30d5975 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_by_resource_group_with_$expand=administrators.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group_with_expand_equals_administrators.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_servers_by_resource_group_with_$expand=administrators.py + python server_list_by_resource_group_with_expand_equals_administrators.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_with_expand_equals_administrators.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_servers_with_expand_equals_administrators.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_list_with_expand_equals_administrators.py index f821ad93794c..44393f0ac9b6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_with_expand_equals_administrators.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_with_expand_equals_administrators.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_servers_with_expand_equals_administrators.py + python server_list_with_expand_equals_administrators.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_server_recommended_actions_for_all_advisors.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_recommended_action_list_expand.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_of_server_recommended_actions_for_all_advisors.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_recommended_action_list_expand.py index 3a144f88eaf2..7cfb2c308871 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_of_server_recommended_actions_for_all_advisors.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_recommended_action_list_expand.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_of_server_recommended_actions_for_all_advisors.py + python server_recommended_action_list_expand.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_threat_detection_policy_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_threat_detection_policy_with_all_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_max.py index 9445c18faca0..7685267bfe4e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_threat_detection_policy_with_all_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_server's_threat_detection_policy_with_all_parameters.py + python server_security_alerts_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_threat_detection_policy_with_minimal_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_min.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_threat_detection_policy_with_minimal_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_min.py index 2f9da9a71b14..58fafd057c0e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server's_threat_detection_policy_with_minimal_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_server's_threat_detection_policy_with_minimal_parameters.py + python server_security_alerts_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_threat_detection_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_threat_detection_policy.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_get.py index f2ca3698ae67..58ab4b119436 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_threat_detection_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_server's_threat_detection_policy.py + python server_security_alerts_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server's_threat_detection_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_list_by_server.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_the_server's_threat_detection_policies.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_list_by_server.py index cfb574ba7435..99413f1f6b99 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_the_server's_threat_detection_policies.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_list_by_server.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_the_server's_threat_detection_policies.py + python server_security_alerts_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_server_trust_certificate..py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_create.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_server_trust_certificate..py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_create.py index b639823482f1..20581b93b267 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_server_trust_certificate..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_server_trust_certificate..py + python server_trust_certificates_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_server_trust_certificate..py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_server_trust_certificate..py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py index 8d1096589dc8..d059cbfd7b90 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_server_trust_certificate..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_server_trust_certificate..py + python server_trust_certificates_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_server_trust_certificate..py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_server_trust_certificate..py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_get.py index 48ed13b0f9c1..99d273a476c7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_server_trust_certificate..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_server_trust_certificate..py + python server_trust_certificates_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_server_trust_certificates_on_a_given_server..py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_list_by_instance.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_server_trust_certificates_on_a_given_server..py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_list_by_instance.py index 2e7d76f27c88..26d98f824abe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_list_of_server_trust_certificates_on_a_given_server..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_list_by_instance.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_list_of_server_trust_certificates_on_a_given_server..py + python server_trust_certificates_list_by_instance.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_server_trust_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_create.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_server_trust_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_create.py index 955ae821e83f..2b4d44dffbab 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_server_trust_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_server_trust_group.py + python server_trust_group_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/drop_server_trust_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/drop_server_trust_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py index 2ec9d8e84916..b2eb24b0d89f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/drop_server_trust_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python drop_server_trust_group.py + python server_trust_group_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_server_trust_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_server_trust_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_get.py index 839eb16052b3..5cdb873900c3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_server_trust_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_server_trust_group.py + python server_trust_group_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_trust_groups.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_server_trust_groups.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list.py index 2f6d2b78f399..2da1842e8ea3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_trust_groups.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_server_trust_groups.py + python server_trust_group_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_trust_groups_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list_by_managed_instance.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_server_trust_groups_by_managed_instance.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list_by_managed_instance.py index 6b75f5a32b1c..59c0d1e910b0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_trust_groups_by_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list_by_managed_instance.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_server_trust_groups_by_managed_instance.py + python server_trust_group_list_by_managed_instance.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_update.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_server.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_update.py index 8479de83c59b..a14317738c89 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_server.py + python server_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_usages.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_usage_metrics_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_servers_usages.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_usage_metrics_list.py index 21788278b1af..196ac93b31f0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_servers_usages.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_usage_metrics_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_servers_usages.py + python server_usage_metrics_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_container_sas_key_min.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_container_sas_key_min.py index 984d77d3364f..86fbbc6d85ce 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_container_sas_key_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_container_sas_key_is_specified.py + python server_vulnerability_assessment_create_container_sas_key_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_all_parameters.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_max.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_all_parameters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_max.py index 08e95112edae..5671d8bc63a0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_all_parameters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_max.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_server's_vulnerability_assessment_with_all_parameters.py + python server_vulnerability_assessment_create_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_storage_access_key_min.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_storage_access_key_min.py index 044af8dcea69..afdf46ef8b8d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_storage_access_key_min.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_server's_vulnerability_assessment_with_minimal_parameters,_when_storage_account_access_key_is_specified.py + python server_vulnerability_assessment_create_storage_access_key_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/remove_a_server's_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/remove_a_server's_vulnerability_assessment.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py index 54200b7f48bc..4d87229ce241 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/remove_a_server's_vulnerability_assessment.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python remove_a_server's_vulnerability_assessment.py + python server_vulnerability_assessment_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_vulnerability_assessment.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_get.py index c07cff030020..7eaf89a6a8a3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_vulnerability_assessment.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_server's_vulnerability_assessment.py + python server_vulnerability_assessment_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_vulnerability_assessment_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_list_by_server.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_vulnerability_assessment_policies.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_list_by_server.py index cf03dfd7aa92..0b721642c197 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_server's_vulnerability_assessment_policies.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_list_by_server.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_server's_vulnerability_assessment_policies.py + python server_vulnerability_assessment_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_service_objective.py b/sdk/sql/azure-mgmt-sql/generated_samples/service_objective_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_service_objective.py rename to sdk/sql/azure-mgmt-sql/generated_samples/service_objective_get.py index 6edfc52a739d..73e1c51aa36e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_service_objective.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/service_objective_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_service_objective.py + python service_objective_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_service_objectives.py b/sdk/sql/azure-mgmt-sql/generated_samples/service_objective_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_service_objectives.py rename to sdk/sql/azure-mgmt-sql/generated_samples/service_objective_list.py index cf0fd5215588..17758295e5eb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_service_objectives.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/service_objective_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_service_objectives.py + python service_objective_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_current_instance_sql_agent_configuration..py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_current_instance_sql_agent_configuration..py rename to sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_get.py index 6467bedde389..3c2da6291c3f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_current_instance_sql_agent_configuration..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_current_instance_sql_agent_configuration..py + python sql_agent_configuration_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/puts_new_sql_agent_configuration_to_instance..py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_put.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/puts_new_sql_agent_configuration_to_instance..py rename to sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_put.py index a80628387657..9680488f5c3d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/puts_new_sql_agent_configuration_to_instance..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_put.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python puts_new_sql_agent_configuration_to_instance..py + python sql_agent_configuration_put.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, 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 new file mode 100644 index 000000000000..84bb76a24f7d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 sql_tde_certificate_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-0000-0000-0000-000000000001", + ) + + 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/preview/2020-11-01-preview/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 new file mode 100644 index 000000000000..4e12146256ee --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py @@ -0,0 +1,52 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 sql_vulnerability_assessment_baseline_add.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.sql_vulnerability_assessment_baselines.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + vulnerability_assessment_name="default", + baseline_name="default", + parameters={ + "properties": { + "latestScan": False, + "results": { + "VA2063": [["AllowAll", "0.0.0.0", "255.255.255.255"]], + "VA2065": [["AllowAll", "0.0.0.0", "255.255.255.255"]], + }, + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/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 new file mode 100644 index 000000000000..121d0d9b0910 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add_latest.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) 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 sql_vulnerability_assessment_baseline_add_latest.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.sql_vulnerability_assessment_baselines.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + baseline_name="default", + parameters={"properties": {"latestScan": True, "results": {}}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/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 new file mode 100644 index 000000000000..0a6daeed89bc --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 sql_vulnerability_assessment_baseline_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.sql_vulnerability_assessment_baseline.get( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + vulnerability_assessment_name="default", + baseline_name="default", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/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 new file mode 100644 index 000000000000..86b8fd3b0354 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.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) 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 sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.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.sql_vulnerability_assessment_baseline.list_by_sql_vulnerability_assessment( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + vulnerability_assessment_name="default", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_sql_vulnerability_assessment_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_sql_vulnerability_assessment_policy.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py index 493510b98201..d92aae9d3057 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_sql_vulnerability_assessment_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_sql_vulnerability_assessment_policy.py + python sql_vulnerability_assessment_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/remove_sql_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/remove_sql_vulnerability_assessment.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py index 15a68f5b588a..50c8d5808f55 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/remove_sql_vulnerability_assessment.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python remove_sql_vulnerability_assessment.py + python sql_vulnerability_assessment_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policy.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py index bd572aa986de..0cd52a7cf2ea 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_sql_vulnerability_assessment_policy.py + python sql_vulnerability_assessment_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policies.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policies.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py index d427542f2242..983fffd74868 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_sql_vulnerability_assessment_policies.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_sql_vulnerability_assessment_policies.py + python sql_vulnerability_assessment_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_system_database_sql_vulnerability_assessment_scan_results_for_scan_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_system_database_sql_vulnerability_assessment_scan_results_for_scan_id.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py index 78ac0692bcf9..dfaab96dedd3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_system_database_sql_vulnerability_assessment_scan_results_for_scan_id.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_system_database_sql_vulnerability_assessment_scan_results_for_scan_id.py + python sql_vulnerability_assessment_list_scans_results.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, 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 new file mode 100644 index 000000000000..c6963c7a22ac --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 sql_vulnerability_assessment_rule_baseline_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.sql_vulnerability_assessment_rule_baseline.create_or_update( + resource_group_name="vulnerabilityaseessmenttest-4799", + server_name="vulnerabilityaseessmenttest-6440", + vulnerability_assessment_name="default", + baseline_name="default", + rule_id="VA1001", + parameters={ + "properties": { + "latestScan": False, + "results": [["userA", "SELECT"], ["userB", "SELECT"], ["userC", "SELECT"]], + } + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/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 new file mode 100644 index 000000000000..d6ff3d83d2f8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_delete.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) 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 sql_vulnerability_assessment_rule_baseline_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.sql_vulnerability_assessment_rule_baselines.delete( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + vulnerability_assessment_name="default", + baseline_name="default", + rule_id="VA1001", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/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 new file mode 100644 index 000000000000..9dbf4a7dec6f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_get.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) 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 sql_vulnerability_assessment_rule_baseline_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.sql_vulnerability_assessment_rule_baseline.get( + resource_group_name="vulnerabilityaseessmenttest-4711", + server_name="vulnerabilityaseessmenttest-6411", + vulnerability_assessment_name="default", + baseline_name="default", + rule_id="VA1001", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_system_database's_sql_vulnerability_assessment_rule_baseline..py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_system_database's_sql_vulnerability_assessment_rule_baseline..py rename to sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py index 0c00187c26bc..558be462ae90 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_system_database's_sql_vulnerability_assessment_rule_baseline..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_system_database's_sql_vulnerability_assessment_rule_baseline..py + python sql_vulnerability_assessment_rule_baseline_list_by_baseline.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_a_database_vulnerability_assessment_scan_records.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_the_a_database_vulnerability_assessment_scan_records.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py index cab4f5507ed5..3bd9a1fb0e3d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_the_a_database_vulnerability_assessment_scan_records.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_the_a_database_vulnerability_assessment_scan_records.py + python sql_vulnerability_assessment_scan.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, 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 new file mode 100644 index 000000000000..0bd2dded3e32 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.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) 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 sql_vulnerability_assessment_scan_records_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.sql_vulnerability_assessment_scans.list_by_sql_vulnerability_assessments( + resource_group_name="vulnerabilityassessmenttest-4711", + server_name="vulnerabilityassessmenttest-6411", + vulnerability_assessment_name="default", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/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 new file mode 100644 index 000000000000..497f26ca0dbf --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_execute.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 sql_vulnerability_assessment_scans_execute.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.sql_vulnerability_assessment_execute_scan.begin_execute( + resource_group_name="vulnerabilityassessmenttest-4711", + server_name="vulnerabilityassessmenttest-6411", + vulnerability_assessment_name="default", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentScansExecute.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_system_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py similarity index 94% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_system_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py index 871058a5be19..a5018b9028ad 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_system_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_system_database_sql_vulnerability_assessment_scan_result_for_scan_id_and_scan_result_id.py + python sql_vulnerability_assessment_scans_results.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_specific_subscription_usage_in_the_given_location..py b/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_get.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_specific_subscription_usage_in_the_given_location..py rename to sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_get.py index b367871d5e62..5e43181a2d3c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_specific_subscription_usage_in_the_given_location..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_specific_subscription_usage_in_the_given_location..py + python subscription_usage_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_subscription_usages_in_the_given_location..py b/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_list_by_location.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_subscription_usages_in_the_given_location..py rename to sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_list_by_location.py index 25fd5ca77ae2..3b1486f80e5b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_subscription_usages_in_the_given_location..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_list_by_location.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_subscription_usages_in_the_given_location..py + python subscription_usage_list_by_location.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_all_synapselink_workspaces_for_the_given_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/synapse_link_workspace_list_by_database.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_all_synapselink_workspaces_for_the_given_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/synapse_link_workspace_list_by_database.py index 07836d675c50..ebd926c67fea 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_all_synapselink_workspaces_for_the_given_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/synapse_link_workspace_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_all_synapselink_workspaces_for_the_given_database..py + python synapse_link_workspace_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_new_sync_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_create.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_new_sync_agent.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_create.py index ccf7f2c2bb00..c692cb3514cc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_new_sync_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_new_sync_agent.py + python sync_agent_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_agent.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py index a4d3ba76a2c0..b6560bb782e8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_a_sync_agent.py + python sync_agent_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/generate_a_sync_agent_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_generate_key.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/generate_a_sync_agent_key.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_generate_key.py index 2ad5c5eb50dc..61cb966f8145 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/generate_a_sync_agent_key.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_generate_key.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python generate_a_sync_agent_key.py + python sync_agent_generate_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_agent.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get.py index 24b913111c60..5bd6bd1d6235 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_sync_agent.py + python sync_agent_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_sync_agent_linked_databases.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get_linked_databases.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_sync_agent_linked_databases.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get_linked_databases.py index 0b2bd6025774..ba594c4ba858 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_sync_agent_linked_databases.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get_linked_databases.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_sync_agent_linked_databases.py + python sync_agent_get_linked_databases.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_sync_agents_under_a_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_list_by_server.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_sync_agents_under_a_server.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_list_by_server.py index 9313065c0ce8..be7e747242d2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_sync_agents_under_a_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_list_by_server.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_sync_agents_under_a_server.py + python sync_agent_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_update.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_agent.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_update.py index 81cbe1557d0c..e03de9ff045b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_sync_agent.py + python sync_agent_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_a_sync_group_synchronization.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/cancel_a_sync_group_synchronization.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py index 9401d180a592..44dd66dbd5b4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_a_sync_group_synchronization.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python cancel_a_sync_group_synchronization.py + python sync_group_cancel_sync.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_sync_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_sync_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create.py index 952e819d3cb3..ccd18c4c80da 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_sync_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_sync_group.py + python sync_group_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py index 7282e7906810..233e9e7f5ff7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_a_sync_group.py + python sync_group_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get.py index 465fb0266486..4c59d42489cf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_sync_group.py + python sync_group_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_hub_database_schema..py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_hub_schema.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_hub_database_schema..py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_hub_schema.py index 85716fad4a25..27e0f17ab4d6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_hub_database_schema..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_hub_schema.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_hub_database_schema..py + python sync_group_get_hub_schema.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_sync_group_logs.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_log.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_sync_group_logs.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_log.py index df45c93608b0..c0b606ab4719 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_sync_group_logs.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_log.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_sync_group_logs.py + python sync_group_get_log.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_database_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_sync_database_id.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_database_id.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_sync_database_id.py index 6c9332664eda..b85cbcad4cb9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_database_id.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_sync_database_id.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_sync_database_id.py + python sync_group_get_sync_database_id.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_sync_groups_under_a_given_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_list_by_database.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_sync_groups_under_a_given_database.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_group_list_by_database.py index 9c8a4add493a..4731abac2c5a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_sync_groups_under_a_given_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_list_by_database.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_sync_groups_under_a_given_database.py + python sync_group_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, 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 new file mode 100644 index 000000000000..a13611ffcb3b --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license 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 sync_group_patch.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.sync_groups.begin_update( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + parameters={ + "properties": { + "conflictResolutionPolicy": "HubWin", + "hubDatabasePassword": "hubPassword", + "hubDatabaseUserName": "hubUser", + "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: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupPatch.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/refresh_a_hub_database_schema..py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/refresh_a_hub_database_schema..py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py index 1b0e384b6d71..dab504e2f495 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/refresh_a_hub_database_schema..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python refresh_a_hub_database_schema..py + python sync_group_refresh_hub_schema.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/trigger_a_sync_group_synchronization..py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/trigger_a_sync_group_synchronization..py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py index 54a5e40c10b0..820f76ceb692 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/trigger_a_sync_group_synchronization..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python trigger_a_sync_group_synchronization..py + python sync_group_trigger_sync.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_update.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_group_update.py index 0f97672d8ab4..b13ac1f83501 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_sync_group.py + python sync_group_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_new_sync_member.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_a_new_sync_member.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create.py index 5c6dc0109c60..b3c6fba195e1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_a_new_sync_member.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_a_new_sync_member.py + python sync_member_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_member.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_member.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py index 2760237bedb1..e1ffaed7d98e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_sync_member.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_a_sync_member.py + python sync_member_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_member.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_member.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get.py index de1f0f54995e..b7784d90af09 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_member.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_sync_member.py + python sync_member_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_member_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_schema.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_member_schema.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_schema.py index f93cc09a106c..2d46c3ac9038 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_sync_member_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_schema.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_sync_member_schema.py + python sync_member_get_schema.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_sync_members_under_a_sync_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_list_by_sync_group.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_sync_members_under_a_sync_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_member_list_by_sync_group.py index b9f5ae4d4af6..4bce23f44ced 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_sync_members_under_a_sync_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_list_by_sync_group.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_sync_members_under_a_sync_group.py + python sync_member_list_by_sync_group.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_an_existing_sync_member.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_an_existing_sync_member.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch.py index a0a6565405e5..1b05d3be040f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_an_existing_sync_member.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_an_existing_sync_member.py + python sync_member_patch.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/refresh_a_sync_member_database_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/refresh_a_sync_member_database_schema.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py index b331234770c4..783965eb2ec8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/refresh_a_sync_member_database_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python refresh_a_sync_member_database_schema.py + python sync_member_refresh_schema.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_member.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_update.py similarity index 98% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_member.py rename to sdk/sql/azure-mgmt-sql/generated_samples/sync_member_update.py index 7ba5e2d5f051..b287819ac62e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_sync_member.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_sync_member.py + python sync_member_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, 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 new file mode 100644 index 000000000000..e20bf2611fc8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_get.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) 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 transparent_data_encryption_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.transparent_data_encryptions.get( + resource_group_name="security-tde-resourcegroup", + server_name="securitytde", + database_name="testdb", + tde_name="current", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_transparent_data_encryption.py b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_list.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_transparent_data_encryption.py rename to sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_list.py index c771bea6e4de..afa18a94a318 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_a_list_of_the_database's_transparent_data_encryption.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python get_a_list_of_the_database's_transparent_data_encryption.py + python transparent_data_encryption_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, 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 new file mode 100644 index 000000000000..33e08c6b71db --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_update.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) 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 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.create_or_update( + resource_group_name="securitytde-42-rg", + server_name="securitytde-42", + database_name="testdb", + tde_name="current", + parameters={"properties": {"state": "Enabled"}}, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_job_agent's_tags..py b/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_a_job_agent's_tags..py rename to sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent.py index 0bb530f1317c..6367b898c94b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_a_job_agent's_tags..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_a_job_agent's_tags..py + python update_job_agent.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_short_term_retention_policy_for_the_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_the_short_term_retention_policy_for_the_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy.py index 7f1bd9468973..83df76344806 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_short_term_retention_policy_for_the_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_the_short_term_retention_policy_for_the_database..py + python update_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_short_term_retention_policy_for_the_restorable_dropped_database..py b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy_restorable_dropped.py similarity index 95% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_the_short_term_retention_policy_for_the_restorable_dropped_database..py rename to sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy_restorable_dropped.py index dc5db1d7523a..4cbae2fcb5a3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_the_short_term_retention_policy_for_the_restorable_dropped_database..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy_restorable_dropped.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_the_short_term_retention_policy_for_the_restorable_dropped_database..py + python update_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, 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 new file mode 100644 index 000000000000..663ec3b45548 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_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) 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_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 = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + 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: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/UpdateShortTermRetentionPolicy.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/performs_update_of_dns_servers_on_managed_instance..py b/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_dns_servers.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/performs_update_of_dns_servers_on_managed_instance..py rename to sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_dns_servers.py index c7366d7e774b..79c544683464 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/performs_update_of_dns_servers_on_managed_instance..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_dns_servers.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python performs_update_of_dns_servers_on_managed_instance..py + python update_virtual_cluster_dns_servers.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/upgrades_a_data_warehouse..py b/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/upgrades_a_data_warehouse..py rename to sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py index 46a9d0358b12..f5e9033c5a07 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/upgrades_a_data_warehouse..py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python upgrades_a_data_warehouse..py + python upgrade_data_warehouse.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, @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/UpgradeDataWarehouse.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/UpgradeDataWarehouse.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_virtual_cluster.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_virtual_cluster.py rename to sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py index 37e5f8a9fc9f..2d3d33c79358 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_virtual_cluster.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_virtual_cluster.py + python virtual_cluster_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_virtual_cluster.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_virtual_cluster.py rename to sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_get.py index 6c7f439c8340..d5c54b066706 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_virtual_cluster.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_virtual_cluster.py + python virtual_cluster_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_clusters.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_clusters.py rename to sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list.py index 73a8afa3d97a..c24b09cbcbbd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_clusters.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_virtual_clusters.py + python virtual_cluster_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_clusters_by_resource_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list_by_resource_group.py similarity index 96% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_clusters_by_resource_group.py rename to sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list_by_resource_group.py index 1f1b819b91d6..cce68103817f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_clusters_by_resource_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list_by_resource_group.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_virtual_clusters_by_resource_group.py + python virtual_cluster_list_by_resource_group.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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_with_tags.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_update.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_with_tags.py rename to sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_update.py index 9dc34b5c7734..f5074ed941b6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_with_tags.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python update_virtual_cluster_with_tags.py + python virtual_cluster_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_virtual_network_rule.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_create_or_update.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_virtual_network_rule.py rename to sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_create_or_update.py index 6050075e3017..99d9350b33d8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_a_virtual_network_rule.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_create_or_update.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python create_or_update_a_virtual_network_rule.py + python virtual_network_rules_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_virtual_network_rule.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/delete_a_virtual_network_rule.py rename to sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py index 7787e9b8831a..09063092517b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_a_virtual_network_rule.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python delete_a_virtual_network_rule.py + python virtual_network_rules_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_virtual_network_rule.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_get.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/gets_a_virtual_network_rule.py rename to sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_get.py index 8fff2dbbba8f..edbb19a9740e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/gets_a_virtual_network_rule.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_get.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python gets_a_virtual_network_rule.py + python virtual_network_rules_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, diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_network_rules.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_list.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_network_rules.py rename to sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_list.py index eefb512a1706..cd4e8ac971c6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_virtual_network_rules.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_list.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python list_virtual_network_rules.py + python virtual_network_rules_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,