From 85132dca0594bfb6daeeffbb55a05cbce816a72a Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 27 Jun 2023 00:07:26 -0700 Subject: [PATCH] [AutoRelease] t2-sql-2023-06-27-53795(can only be merged by SDK owner) (#30903) * code and test * Update CHANGELOG.md --------- Co-authored-by: PythonSdkPipelines Co-authored-by: Yuchao Yan --- sdk/sql/azure-mgmt-sql/CHANGELOG.md | 7 + sdk/sql/azure-mgmt-sql/_meta.json | 6 +- .../azure/mgmt/sql/_serialization.py | 6 +- .../azure/mgmt/sql/_sql_management_client.py | 220 ++++----- .../azure-mgmt-sql/azure/mgmt/sql/_version.py | 2 +- .../mgmt/sql/aio/_sql_management_client.py | 220 ++++----- .../azure/mgmt/sql/aio/operations/__init__.py | 88 ++-- ...hort_term_retention_policies_operations.py | 34 +- .../operations/_capabilities_operations.py | 9 +- .../_data_masking_policies_operations.py | 7 +- .../_data_masking_rules_operations.py | 7 +- ...ta_warehouse_user_activities_operations.py | 13 +- ...d_threat_protection_settings_operations.py | 20 +- .../_database_advisors_operations.py | 20 +- .../_database_automatic_tuning_operations.py | 16 +- ...abase_blob_auditing_policies_operations.py | 15 +- .../_database_columns_operations.py | 17 +- ...tabase_encryption_protectors_operations.py | 21 +- .../_database_extensions_operations.py | 24 +- .../_database_operations_operations.py | 13 +- ...database_recommended_actions_operations.py | 20 +- .../_database_schemas_operations.py | 13 +- ...base_security_alert_policies_operations.py | 20 +- ...ability_assessment_baselines_operations.py | 20 +- ...lity_assessment_execute_scan_operations.py | 13 +- ...ty_assessment_rule_baselines_operations.py | 24 +- ...ility_assessment_scan_result_operations.py | 21 +- ...lnerability_assessment_scans_operations.py | 13 +- ...ability_assessments_settings_operations.py | 13 +- .../operations/_database_tables_operations.py | 13 +- .../operations/_database_usages_operations.py | 9 +- ...ty_assessment_rule_baselines_operations.py | 20 +- ...lnerability_assessment_scans_operations.py | 25 +- ...se_vulnerability_assessments_operations.py | 24 +- .../aio/operations/_databases_operations.py | 112 ++--- .../operations/_deleted_servers_operations.py | 25 +- ...tributed_availability_groups_operations.py | 42 +- .../_elastic_pool_activities_operations.py | 7 +- ...tic_pool_database_activities_operations.py | 7 +- .../_elastic_pool_operations_operations.py | 13 +- .../operations/_elastic_pools_operations.py | 54 +-- .../_encryption_protectors_operations.py | 32 +- .../_endpoint_certificates_operations.py | 13 +- ...abase_blob_auditing_policies_operations.py | 15 +- ...erver_blob_auditing_policies_operations.py | 19 +- .../operations/_failover_groups_operations.py | 350 ++++++++++----- .../operations/_firewall_rules_operations.py | 30 +- .../_geo_backup_policies_operations.py | 14 +- .../_instance_failover_groups_operations.py | 48 +- .../operations/_instance_pools_operations.py | 46 +- .../_ipv6_firewall_rules_operations.py | 24 +- .../aio/operations/_job_agents_operations.py | 42 +- .../operations/_job_credentials_operations.py | 24 +- .../operations/_job_executions_operations.py | 37 +- .../_job_step_executions_operations.py | 13 +- .../aio/operations/_job_steps_operations.py | 32 +- .../_job_target_executions_operations.py | 17 +- .../_job_target_groups_operations.py | 24 +- .../operations/_job_versions_operations.py | 13 +- .../sql/aio/operations/_jobs_operations.py | 24 +- .../_ledger_digest_uploads_operations.py | 32 +- ..._long_term_retention_backups_operations.py | 94 ++-- ...ion_managed_instance_backups_operations.py | 53 +-- ...long_term_retention_policies_operations.py | 24 +- .../_maintenance_window_options_operations.py | 9 +- .../_maintenance_windows_operations.py | 16 +- ...hort_term_retention_policies_operations.py | 34 +- ...d_threat_protection_settings_operations.py | 20 +- .../_managed_database_columns_operations.py | 17 +- ...ged_database_move_operations_operations.py | 13 +- .../_managed_database_queries_operations.py | 13 +- ...commended_sensitivity_labels_operations.py | 12 +- ...ged_database_restore_details_operations.py | 9 +- .../_managed_database_schemas_operations.py | 13 +- ...base_security_alert_policies_operations.py | 20 +- ...ged_database_security_events_operations.py | 9 +- ..._database_sensitivity_labels_operations.py | 37 +- .../_managed_database_tables_operations.py | 13 +- ..._transparent_data_encryption_operations.py | 20 +- ...ty_assessment_rule_baselines_operations.py | 20 +- ...lnerability_assessment_scans_operations.py | 25 +- ...se_vulnerability_assessments_operations.py | 24 +- .../_managed_databases_operations.py | 86 +--- ...aged_instance_administrators_operations.py | 32 +- ...d_threat_protection_settings_operations.py | 24 +- ...zure_ad_only_authentications_operations.py | 32 +- .../_managed_instance_dtcs_operations.py | 24 +- ...stance_encryption_protectors_operations.py | 32 +- .../_managed_instance_keys_operations.py | 32 +- ...long_term_retention_policies_operations.py | 24 +- ..._managed_instance_operations_operations.py | 17 +- ...private_endpoint_connections_operations.py | 32 +- ...tance_private_link_resources_operations.py | 13 +- ...ed_instance_tde_certificates_operations.py | 16 +- ...ce_vulnerability_assessments_operations.py | 24 +- .../_managed_instances_operations.py | 82 +--- ...anaged_ledger_digest_uploads_operations.py | 32 +- ...hort_term_retention_policies_operations.py | 34 +- .../_managed_server_dns_aliases_operations.py | 42 +- ...rver_security_alert_policies_operations.py | 24 +- .../mgmt/sql/aio/operations/_operations.py | 9 +- .../_outbound_firewall_rules_operations.py | 32 +- ...private_endpoint_connections_operations.py | 32 +- .../_private_link_resources_operations.py | 13 +- ...commended_sensitivity_labels_operations.py | 12 +- .../_recoverable_databases_operations.py | 13 +- ...ecoverable_managed_databases_operations.py | 13 +- .../_replication_links_operations.py | 41 +- ...restorable_dropped_databases_operations.py | 13 +- ...le_dropped_managed_databases_operations.py | 13 +- .../operations/_restore_points_operations.py | 28 +- .../_sensitivity_labels_operations.py | 37 +- ...d_threat_protection_settings_operations.py | 24 +- .../operations/_server_advisors_operations.py | 20 +- .../_server_automatic_tuning_operations.py | 16 +- ...rver_azure_ad_administrators_operations.py | 32 +- ...zure_ad_only_authentications_operations.py | 32 +- ...erver_blob_auditing_policies_operations.py | 19 +- .../_server_communication_links_operations.py | 18 +- ...server_configuration_options_operations.py | 24 +- .../_server_connection_policies_operations.py | 24 +- ...erver_dev_ops_audit_settings_operations.py | 24 +- .../_server_dns_aliases_operations.py | 40 +- .../aio/operations/_server_keys_operations.py | 32 +- .../_server_operations_operations.py | 9 +- ...rver_security_alert_policies_operations.py | 24 +- .../_server_trust_certificates_operations.py | 32 +- .../_server_trust_groups_operations.py | 36 +- .../operations/_server_usages_operations.py | 7 +- ...er_vulnerability_assessments_operations.py | 24 +- .../sql/aio/operations/_servers_operations.py | 70 +-- .../_service_objectives_operations.py | 9 +- .../aio/operations/_sql_agent_operations.py | 16 +- ...rability_assessment_baseline_operations.py | 8 +- ...ability_assessment_baselines_operations.py | 7 +- ...lity_assessment_execute_scan_operations.py | 8 +- ...ity_assessment_rule_baseline_operations.py | 15 +- ...ty_assessment_rule_baselines_operations.py | 4 +- ...ility_assessment_scan_result_operations.py | 16 +- ...lnerability_assessment_scans_operations.py | 8 +- ...ql_vulnerability_assessments_operations.py | 9 +- ...ability_assessments_settings_operations.py | 20 +- ...p_managed_instance_schedules_operations.py | 24 +- .../_subscription_usages_operations.py | 13 +- .../_synapse_link_workspaces_operations.py | 9 +- .../aio/operations/_sync_agents_operations.py | 40 +- .../aio/operations/_sync_groups_operations.py | 70 +-- .../operations/_sync_members_operations.py | 54 +-- .../_tde_certificates_operations.py | 16 +- .../aio/operations/_time_zones_operations.py | 13 +- ...transparent_data_encryptions_operations.py | 24 +- .../sql/aio/operations/_usages_operations.py | 9 +- .../_virtual_clusters_operations.py | 44 +- .../_virtual_network_rules_operations.py | 32 +- .../_workload_classifiers_operations.py | 32 +- .../operations/_workload_groups_operations.py | 32 +- .../azure/mgmt/sql/models/__init__.py | 2 - .../azure/mgmt/sql/models/_models_py3.py | 13 +- .../models/_sql_management_client_enums.py | 7 +- .../azure/mgmt/sql/operations/__init__.py | 88 ++-- ...hort_term_retention_policies_operations.py | 50 +-- .../operations/_capabilities_operations.py | 13 +- .../_data_masking_policies_operations.py | 11 +- .../_data_masking_rules_operations.py | 11 +- ...ta_warehouse_user_activities_operations.py | 21 +- ...d_threat_protection_settings_operations.py | 32 +- .../_database_advisors_operations.py | 32 +- .../_database_automatic_tuning_operations.py | 24 +- ...abase_blob_auditing_policies_operations.py | 27 +- .../_database_columns_operations.py | 29 +- ...tabase_encryption_protectors_operations.py | 29 +- .../_database_extensions_operations.py | 36 +- .../_database_operations_operations.py | 21 +- ...database_recommended_actions_operations.py | 32 +- .../_database_schemas_operations.py | 21 +- ...base_security_alert_policies_operations.py | 32 +- ...ability_assessment_baselines_operations.py | 32 +- ...lity_assessment_execute_scan_operations.py | 17 +- ...ty_assessment_rule_baselines_operations.py | 40 +- ...ility_assessment_scan_result_operations.py | 33 +- ...lnerability_assessment_scans_operations.py | 21 +- ...ability_assessments_settings_operations.py | 21 +- .../operations/_database_tables_operations.py | 21 +- .../operations/_database_usages_operations.py | 13 +- ...ty_assessment_rule_baselines_operations.py | 32 +- ...lnerability_assessment_scans_operations.py | 41 +- ...se_vulnerability_assessments_operations.py | 40 +- .../sql/operations/_databases_operations.py | 172 ++----- .../operations/_deleted_servers_operations.py | 41 +- ...tributed_availability_groups_operations.py | 62 +-- .../_elastic_pool_activities_operations.py | 9 +- ...tic_pool_database_activities_operations.py | 9 +- .../_elastic_pool_operations_operations.py | 21 +- .../operations/_elastic_pools_operations.py | 82 +--- .../_encryption_protectors_operations.py | 48 +- .../_endpoint_certificates_operations.py | 21 +- ...abase_blob_auditing_policies_operations.py | 27 +- ...erver_blob_auditing_policies_operations.py | 31 +- .../operations/_failover_groups_operations.py | 425 +++++++++++------- .../operations/_firewall_rules_operations.py | 50 +-- .../_geo_backup_policies_operations.py | 20 +- .../_instance_failover_groups_operations.py | 72 +-- .../operations/_instance_pools_operations.py | 70 +-- .../_ipv6_firewall_rules_operations.py | 40 +- .../sql/operations/_job_agents_operations.py | 62 +-- .../operations/_job_credentials_operations.py | 40 +- .../operations/_job_executions_operations.py | 61 +-- .../_job_step_executions_operations.py | 21 +- .../sql/operations/_job_steps_operations.py | 56 +-- .../_job_target_executions_operations.py | 29 +- .../_job_target_groups_operations.py | 40 +- .../operations/_job_versions_operations.py | 21 +- .../mgmt/sql/operations/_jobs_operations.py | 40 +- .../_ledger_digest_uploads_operations.py | 48 +- ..._long_term_retention_backups_operations.py | 150 ++----- ...ion_managed_instance_backups_operations.py | 93 +--- ...long_term_retention_policies_operations.py | 36 +- .../_maintenance_window_options_operations.py | 13 +- .../_maintenance_windows_operations.py | 24 +- ...hort_term_retention_policies_operations.py | 50 +-- ...d_threat_protection_settings_operations.py | 32 +- .../_managed_database_columns_operations.py | 29 +- ...ged_database_move_operations_operations.py | 21 +- .../_managed_database_queries_operations.py | 21 +- ...commended_sensitivity_labels_operations.py | 16 +- ...ged_database_restore_details_operations.py | 13 +- .../_managed_database_schemas_operations.py | 21 +- ...base_security_alert_policies_operations.py | 32 +- ...ged_database_security_events_operations.py | 13 +- ..._database_sensitivity_labels_operations.py | 69 +-- .../_managed_database_tables_operations.py | 21 +- ..._transparent_data_encryption_operations.py | 32 +- ...ty_assessment_rule_baselines_operations.py | 32 +- ...lnerability_assessment_scans_operations.py | 41 +- ...se_vulnerability_assessments_operations.py | 40 +- .../_managed_databases_operations.py | 126 ++---- ...aged_instance_administrators_operations.py | 48 +- ...d_threat_protection_settings_operations.py | 36 +- ...zure_ad_only_authentications_operations.py | 48 +- .../_managed_instance_dtcs_operations.py | 36 +- ...stance_encryption_protectors_operations.py | 48 +- .../_managed_instance_keys_operations.py | 48 +- ...long_term_retention_policies_operations.py | 36 +- ..._managed_instance_operations_operations.py | 29 +- ...private_endpoint_connections_operations.py | 48 +- ...tance_private_link_resources_operations.py | 21 +- ...ed_instance_tde_certificates_operations.py | 20 +- ...ce_vulnerability_assessments_operations.py | 40 +- .../_managed_instances_operations.py | 130 ++---- ...anaged_ledger_digest_uploads_operations.py | 48 +- ...hort_term_retention_policies_operations.py | 50 +-- .../_managed_server_dns_aliases_operations.py | 62 +-- ...rver_security_alert_policies_operations.py | 36 +- .../azure/mgmt/sql/operations/_operations.py | 13 +- .../_outbound_firewall_rules_operations.py | 48 +- ...private_endpoint_connections_operations.py | 48 +- .../_private_link_resources_operations.py | 21 +- ...commended_sensitivity_labels_operations.py | 16 +- .../_recoverable_databases_operations.py | 21 +- ...ecoverable_managed_databases_operations.py | 21 +- .../_replication_links_operations.py | 65 +-- ...restorable_dropped_databases_operations.py | 21 +- ...le_dropped_managed_databases_operations.py | 21 +- .../operations/_restore_points_operations.py | 44 +- .../_sensitivity_labels_operations.py | 69 +-- ...d_threat_protection_settings_operations.py | 36 +- .../operations/_server_advisors_operations.py | 32 +- .../_server_automatic_tuning_operations.py | 24 +- ...rver_azure_ad_administrators_operations.py | 48 +- ...zure_ad_only_authentications_operations.py | 48 +- ...erver_blob_auditing_policies_operations.py | 31 +- .../_server_communication_links_operations.py | 26 +- ...server_configuration_options_operations.py | 36 +- .../_server_connection_policies_operations.py | 36 +- ...erver_dev_ops_audit_settings_operations.py | 36 +- .../_server_dns_aliases_operations.py | 60 +-- .../sql/operations/_server_keys_operations.py | 48 +- .../_server_operations_operations.py | 13 +- ...rver_security_alert_policies_operations.py | 36 +- .../_server_trust_certificates_operations.py | 48 +- .../_server_trust_groups_operations.py | 56 +-- .../operations/_server_usages_operations.py | 9 +- ...er_vulnerability_assessments_operations.py | 40 +- .../sql/operations/_servers_operations.py | 106 ++--- .../_service_objectives_operations.py | 13 +- .../sql/operations/_sql_agent_operations.py | 24 +- ...rability_assessment_baseline_operations.py | 16 +- ...ability_assessment_baselines_operations.py | 11 +- ...lity_assessment_execute_scan_operations.py | 12 +- ...ity_assessment_rule_baseline_operations.py | 27 +- ...ty_assessment_rule_baselines_operations.py | 8 +- ...ility_assessment_scan_result_operations.py | 28 +- ...lnerability_assessment_scans_operations.py | 16 +- ...ql_vulnerability_assessments_operations.py | 13 +- ...ability_assessments_settings_operations.py | 32 +- ...p_managed_instance_schedules_operations.py | 40 +- .../_subscription_usages_operations.py | 21 +- .../_synapse_link_workspaces_operations.py | 13 +- .../sql/operations/_sync_agents_operations.py | 64 +-- .../sql/operations/_sync_groups_operations.py | 114 ++--- .../operations/_sync_members_operations.py | 82 +--- .../_tde_certificates_operations.py | 20 +- .../sql/operations/_time_zones_operations.py | 21 +- ...transparent_data_encryptions_operations.py | 36 +- .../mgmt/sql/operations/_usages_operations.py | 13 +- .../_virtual_clusters_operations.py | 68 +-- .../_virtual_network_rules_operations.py | 48 +- .../_workload_classifiers_operations.py | 48 +- .../operations/_workload_groups_operations.py | 48 +- .../generated_samples/administrator_delete.py | 3 +- .../azure_ad_only_auth_delete.py | 3 +- .../cancel_database_operation.py | 3 +- .../cancel_elastic_pool_operation.py | 3 +- .../generated_samples/cancel_job_execution.py | 3 +- .../cancel_managed_instance_operation.py | 3 +- .../column_sensitivity_label_delete.py | 3 +- .../create_or_update_maintenance_windows.py | 3 +- ...atabase_encryption_protector_revalidate.py | 3 +- .../database_encryption_protector_revert.py | 3 +- .../database_restore_points_delete.py | 3 +- ...l_vulnerability_assessment_baseline_add.py | 2 +- ...rability_assessment_baseline_add_latest.py | 2 +- ...l_vulnerability_assessment_baseline_get.py | 2 +- ...ne_list_by_sql_vulnerability_assessment.py | 2 +- ...tabase_sql_vulnerability_assessment_get.py | 2 +- ...lnerability_assessment_list_by_database.py | 2 +- ...erability_assessment_list_scans_results.py | 2 +- ...ability_assessment_rule_baseline_create.py | 2 +- ...ability_assessment_rule_baseline_delete.py | 5 +- ...nerability_assessment_rule_baseline_get.py | 2 +- ...sessment_rule_baseline_list_by_baseline.py | 2 +- ...abase_sql_vulnerability_assessment_scan.py | 2 +- ...ssessment_scan_records_list_by_database.py | 2 +- ..._vulnerability_assessment_scans_execute.py | 5 +- ..._vulnerability_assessment_scans_results.py | 2 +- ...atabase_vulnerability_assessment_delete.py | 3 +- ...ability_assessment_rule_baseline_delete.py | 3 +- ..._vulnerability_assessment_scans_execute.py | 3 +- .../generated_samples/delete_database.py | 3 +- .../generated_samples/delete_instance_pool.py | 3 +- .../generated_samples/delete_job.py | 3 +- .../generated_samples/delete_job_agent.py | 3 +- .../delete_job_credential.py | 3 +- .../generated_samples/delete_job_step.py | 3 +- .../delete_job_target_group.py | 3 +- .../delete_workload_classifier.py | 3 +- .../delete_workload_group.py | 3 +- .../distributed_availability_groups_delete.py | 3 +- .../generated_samples/elastic_pool_delete.py | 3 +- .../elastic_pool_metrics_list_with_filter.py | 44 -- .../encryption_protector_revalidate.py | 3 +- .../generated_samples/failover_database.py | 3 +- .../failover_elastic_pool.py | 3 +- .../failover_group_create_or_update.py | 2 +- .../failover_group_delete.py | 5 +- .../failover_group_failover.py | 2 +- ...er_group_force_failover_allow_data_loss.py | 2 +- .../generated_samples/failover_group_get.py | 2 +- .../generated_samples/failover_group_list.py | 2 +- ...oup_try_planned_before_forced_failover.py} | 18 +- .../failover_group_update.py | 2 +- .../failover_managed_instance.py | 3 +- .../generated_samples/firewall_rule_delete.py | 3 +- .../get_database_extensions.py | 3 +- .../instance_failover_group_delete.py | 3 +- .../ipv6_firewall_rule_create.py | 2 +- .../ipv6_firewall_rule_delete.py | 5 +- .../ipv6_firewall_rule_get.py | 2 +- .../ipv6_firewall_rule_list.py | 2 +- .../ipv6_firewall_rule_update.py | 2 +- .../long_term_retention_backup_delete.py | 3 +- .../managed_database_cancel_move.py | 3 +- ...atabase_column_sensitivity_label_delete.py | 3 +- ...aged_database_complete_external_restore.py | 3 +- .../managed_database_complete_move.py | 3 +- .../managed_database_delete.py | 3 +- ...mended_column_sensitivity_label_disable.py | 3 +- ...mmended_column_sensitivity_label_enable.py | 3 +- ...abase_sensitivity_labels_current_update.py | 3 +- ...e_sensitivity_labels_recommended_update.py | 3 +- .../managed_database_start_move_max.py | 3 +- .../managed_database_start_move_min.py | 3 +- ...atabase_vulnerability_assessment_delete.py | 3 +- ...ability_assessment_rule_baseline_delete.py | 3 +- ..._vulnerability_assessment_scans_execute.py | 3 +- .../managed_instance_administrator_delete.py | 3 +- ...aged_instance_azure_ad_only_auth_delete.py | 3 +- .../managed_instance_delete.py | 3 +- ...nstance_encryption_protector_revalidate.py | 3 +- .../managed_instance_key_delete.py | 3 +- ...tance_long_term_retention_backup_delete.py | 3 +- ...ance_private_endpoint_connection_delete.py | 3 +- .../managed_instance_tde_certificate.py | 3 +- ...nstance_vulnerability_assessment_delete.py | 3 +- .../managed_server_dns_alias_delete.py | 3 +- .../outbound_firewall_rule_delete.py | 3 +- .../private_endpoint_connection_delete.py | 3 +- ...mended_column_sensitivity_label_disable.py | 3 +- ...mmended_column_sensitivity_label_enable.py | 3 +- .../generated_samples/rename_database.py | 3 +- .../replication_link_delete.py | 3 +- ...based_long_term_retention_backup_delete.py | 3 +- ...tance_long_term_retention_backup_delete.py | 3 +- .../sensitivity_labels_current_update.py | 3 +- .../sensitivity_labels_recommended_update.py | 3 +- .../server_communication_link_delete.py | 3 +- .../generated_samples/server_delete.py | 3 +- .../server_dns_alias_delete.py | 3 +- .../generated_samples/server_key_delete.py | 3 +- .../server_trust_certificates_delete.py | 3 +- .../server_trust_group_delete.py | 3 +- .../server_vulnerability_assessment_delete.py | 3 +- .../sql_tde_certificate_create.py | 3 +- ...l_vulnerability_assessment_baseline_add.py | 2 +- ...rability_assessment_baseline_add_latest.py | 2 +- ...l_vulnerability_assessment_baseline_get.py | 2 +- ...ne_list_by_sql_vulnerability_assessment.py | 2 +- .../sql_vulnerability_assessment_create.py | 2 +- .../sql_vulnerability_assessment_delete.py | 5 +- .../sql_vulnerability_assessment_get.py | 2 +- ...vulnerability_assessment_list_by_server.py | 2 +- ...erability_assessment_list_scans_results.py | 2 +- ...ability_assessment_rule_baseline_create.py | 2 +- ...ability_assessment_rule_baseline_delete.py | 5 +- ...nerability_assessment_rule_baseline_get.py | 2 +- ...sessment_rule_baseline_list_by_baseline.py | 2 +- .../sql_vulnerability_assessment_scan.py | 2 +- ...ssessment_scan_records_list_by_database.py | 2 +- ..._vulnerability_assessment_scans_execute.py | 5 +- ..._vulnerability_assessment_scans_results.py | 2 +- .../start_managed_instance.py | 3 +- ...t_stop_managed_instance_schedule_delete.py | 3 +- .../stop_managed_instance.py | 3 +- .../generated_samples/sync_agent_delete.py | 3 +- .../sync_group_cancel_sync.py | 3 +- .../generated_samples/sync_group_delete.py | 3 +- .../sync_group_refresh_hub_schema.py | 3 +- .../sync_group_trigger_sync.py | 3 +- .../generated_samples/sync_member_delete.py | 3 +- .../sync_member_refresh_schema.py | 3 +- .../upgrade_data_warehouse.py | 3 +- .../virtual_cluster_delete.py | 3 +- .../virtual_network_rules_delete.py | 3 +- sdk/sql/azure-mgmt-sql/setup.py | 78 ++-- ....pyTestMgmtSqltest_instance_operation.json | 32 +- 445 files changed, 3326 insertions(+), 7915 deletions(-) delete mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_list_with_filter.py rename sdk/sql/azure-mgmt-sql/generated_samples/{database_metrics_list_with_filter.py => failover_group_try_planned_before_forced_failover.py} (72%) diff --git a/sdk/sql/azure-mgmt-sql/CHANGELOG.md b/sdk/sql/azure-mgmt-sql/CHANGELOG.md index 82d814281495..acdaa0989627 100644 --- a/sdk/sql/azure-mgmt-sql/CHANGELOG.md +++ b/sdk/sql/azure-mgmt-sql/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +## 4.0.0b11 (2023-06-27) + +### Features Added + + - Added operation FailoverGroupsOperations.begin_try_planned_before_forced_failover + - Model SqlVulnerabilityAssessmentScanRecord has a new parameter last_scan_time + ## 4.0.0b10 (2023-04-11) ### Features Added diff --git a/sdk/sql/azure-mgmt-sql/_meta.json b/sdk/sql/azure-mgmt-sql/_meta.json index 86f3d6e44ee2..c864fd05510c 100644 --- a/sdk/sql/azure-mgmt-sql/_meta.json +++ b/sdk/sql/azure-mgmt-sql/_meta.json @@ -1,11 +1,11 @@ { - "commit": "f66499b77cd90144ceb0d118c1bd8bda7dbd4cfc", + "commit": "d03c1964cb76ffd6884d10a1871bbe779a2f68ef", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.4.3", + "@autorest/python@6.6.0", "@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.4.3 --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=/home/vsts/work/1/azure-sdk-for-python/sdk --tag=package-composite-v5 --use=@autorest/python@6.6.0 --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/_serialization.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_serialization.py index f17c068e833e..842ae727fbbc 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_serialization.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_serialization.py @@ -629,7 +629,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if xml_desc.get("attr", False): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): @@ -1271,7 +1271,7 @@ def _extract_name_from_internal_type(internal_type): xml_name = internal_type_xml_map.get("name", internal_type.__name__) xml_ns = internal_type_xml_map.get("ns", None) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) return xml_name @@ -1295,7 +1295,7 @@ def xml_key_extractor(attr, attr_desc, data): # Integrate namespace if necessary xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) if xml_ns: - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) # If it's an attribute, that's simple if xml_desc.get("attr", False): 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 677fd4d07fc5..4dd2b42b6868 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 @@ -235,8 +235,6 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :vartype elastic_pool_operations: azure.mgmt.sql.operations.ElasticPoolOperationsOperations :ivar encryption_protectors: EncryptionProtectorsOperations operations :vartype encryption_protectors: azure.mgmt.sql.operations.EncryptionProtectorsOperations - :ivar failover_groups: FailoverGroupsOperations operations - :vartype failover_groups: azure.mgmt.sql.operations.FailoverGroupsOperations :ivar firewall_rules: FirewallRulesOperations operations :vartype firewall_rules: azure.mgmt.sql.operations.FirewallRulesOperations :ivar instance_pools: InstancePoolsOperations operations @@ -442,8 +440,6 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations :ivar server_trust_certificates: ServerTrustCertificatesOperations operations :vartype server_trust_certificates: azure.mgmt.sql.operations.ServerTrustCertificatesOperations - :ivar ipv6_firewall_rules: IPv6FirewallRulesOperations operations - :vartype ipv6_firewall_rules: azure.mgmt.sql.operations.IPv6FirewallRulesOperations :ivar endpoint_certificates: EndpointCertificatesOperations operations :vartype endpoint_certificates: azure.mgmt.sql.operations.EndpointCertificatesOperations :ivar managed_database_sensitivity_labels: ManagedDatabaseSensitivityLabelsOperations @@ -484,30 +480,6 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :ivar managed_server_dns_aliases: ManagedServerDnsAliasesOperations operations :vartype managed_server_dns_aliases: azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations - :ivar database_sql_vulnerability_assessment_baselines: - DatabaseSqlVulnerabilityAssessmentBaselinesOperations operations - :vartype database_sql_vulnerability_assessment_baselines: - azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations - :ivar database_sql_vulnerability_assessment_execute_scan: - DatabaseSqlVulnerabilityAssessmentExecuteScanOperations operations - :vartype database_sql_vulnerability_assessment_execute_scan: - azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations - :ivar database_sql_vulnerability_assessment_rule_baselines: - DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations operations - :vartype database_sql_vulnerability_assessment_rule_baselines: - azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations - :ivar database_sql_vulnerability_assessment_scan_result: - DatabaseSqlVulnerabilityAssessmentScanResultOperations operations - :vartype database_sql_vulnerability_assessment_scan_result: - azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations - :ivar database_sql_vulnerability_assessment_scans: - DatabaseSqlVulnerabilityAssessmentScansOperations operations - :vartype database_sql_vulnerability_assessment_scans: - azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScansOperations - :ivar database_sql_vulnerability_assessments_settings: - DatabaseSqlVulnerabilityAssessmentsSettingsOperations operations - :vartype database_sql_vulnerability_assessments_settings: - azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations :ivar managed_database_advanced_threat_protection_settings: ManagedDatabaseAdvancedThreatProtectionSettingsOperations operations :vartype managed_database_advanced_threat_protection_settings: @@ -518,40 +490,6 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations :ivar replication_links: ReplicationLinksOperations operations :vartype replication_links: azure.mgmt.sql.operations.ReplicationLinksOperations - :ivar sql_vulnerability_assessment_baseline: SqlVulnerabilityAssessmentBaselineOperations - operations - :vartype sql_vulnerability_assessment_baseline: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselineOperations - :ivar sql_vulnerability_assessment_baselines: SqlVulnerabilityAssessmentBaselinesOperations - operations - :vartype sql_vulnerability_assessment_baselines: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselinesOperations - :ivar sql_vulnerability_assessment_execute_scan: - SqlVulnerabilityAssessmentExecuteScanOperations operations - :vartype sql_vulnerability_assessment_execute_scan: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentExecuteScanOperations - :ivar sql_vulnerability_assessment_rule_baseline: - SqlVulnerabilityAssessmentRuleBaselineOperations operations - :vartype sql_vulnerability_assessment_rule_baseline: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselineOperations - :ivar sql_vulnerability_assessment_rule_baselines: - SqlVulnerabilityAssessmentRuleBaselinesOperations operations - :vartype sql_vulnerability_assessment_rule_baselines: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselinesOperations - :ivar sql_vulnerability_assessment_scan_result: SqlVulnerabilityAssessmentScanResultOperations - operations - :vartype sql_vulnerability_assessment_scan_result: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScanResultOperations - :ivar sql_vulnerability_assessment_scans: SqlVulnerabilityAssessmentScansOperations operations - :vartype sql_vulnerability_assessment_scans: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScansOperations - :ivar sql_vulnerability_assessments_settings: SqlVulnerabilityAssessmentsSettingsOperations - operations - :vartype sql_vulnerability_assessments_settings: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsSettingsOperations - :ivar sql_vulnerability_assessments: SqlVulnerabilityAssessmentsOperations operations - :vartype sql_vulnerability_assessments: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsOperations :ivar managed_database_move_operations: ManagedDatabaseMoveOperationsOperations operations :vartype managed_database_move_operations: azure.mgmt.sql.operations.ManagedDatabaseMoveOperationsOperations @@ -593,6 +531,68 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations :vartype transparent_data_encryptions: azure.mgmt.sql.operations.TransparentDataEncryptionsOperations + :ivar failover_groups: FailoverGroupsOperations operations + :vartype failover_groups: azure.mgmt.sql.operations.FailoverGroupsOperations + :ivar ipv6_firewall_rules: IPv6FirewallRulesOperations operations + :vartype ipv6_firewall_rules: azure.mgmt.sql.operations.IPv6FirewallRulesOperations + :ivar sql_vulnerability_assessment_baseline: SqlVulnerabilityAssessmentBaselineOperations + operations + :vartype sql_vulnerability_assessment_baseline: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselineOperations + :ivar sql_vulnerability_assessment_baselines: SqlVulnerabilityAssessmentBaselinesOperations + operations + :vartype sql_vulnerability_assessment_baselines: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselinesOperations + :ivar sql_vulnerability_assessment_execute_scan: + SqlVulnerabilityAssessmentExecuteScanOperations operations + :vartype sql_vulnerability_assessment_execute_scan: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentExecuteScanOperations + :ivar sql_vulnerability_assessment_rule_baseline: + SqlVulnerabilityAssessmentRuleBaselineOperations operations + :vartype sql_vulnerability_assessment_rule_baseline: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselineOperations + :ivar sql_vulnerability_assessment_rule_baselines: + SqlVulnerabilityAssessmentRuleBaselinesOperations operations + :vartype sql_vulnerability_assessment_rule_baselines: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselinesOperations + :ivar sql_vulnerability_assessment_scan_result: SqlVulnerabilityAssessmentScanResultOperations + operations + :vartype sql_vulnerability_assessment_scan_result: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScanResultOperations + :ivar sql_vulnerability_assessment_scans: SqlVulnerabilityAssessmentScansOperations operations + :vartype sql_vulnerability_assessment_scans: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScansOperations + :ivar sql_vulnerability_assessments_settings: SqlVulnerabilityAssessmentsSettingsOperations + operations + :vartype sql_vulnerability_assessments_settings: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsSettingsOperations + :ivar sql_vulnerability_assessments: SqlVulnerabilityAssessmentsOperations operations + :vartype sql_vulnerability_assessments: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsOperations + :ivar database_sql_vulnerability_assessment_baselines: + DatabaseSqlVulnerabilityAssessmentBaselinesOperations operations + :vartype database_sql_vulnerability_assessment_baselines: + azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations + :ivar database_sql_vulnerability_assessment_execute_scan: + DatabaseSqlVulnerabilityAssessmentExecuteScanOperations operations + :vartype database_sql_vulnerability_assessment_execute_scan: + azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations + :ivar database_sql_vulnerability_assessment_rule_baselines: + DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations operations + :vartype database_sql_vulnerability_assessment_rule_baselines: + azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations + :ivar database_sql_vulnerability_assessment_scan_result: + DatabaseSqlVulnerabilityAssessmentScanResultOperations operations + :vartype database_sql_vulnerability_assessment_scan_result: + azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations + :ivar database_sql_vulnerability_assessment_scans: + DatabaseSqlVulnerabilityAssessmentScansOperations operations + :vartype database_sql_vulnerability_assessment_scans: + azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScansOperations + :ivar database_sql_vulnerability_assessments_settings: + DatabaseSqlVulnerabilityAssessmentsSettingsOperations operations + :vartype database_sql_vulnerability_assessments_settings: + azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription ID that identifies an Azure subscription. Required. @@ -681,7 +681,6 @@ def __init__( self.encryption_protectors = EncryptionProtectorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.failover_groups = FailoverGroupsOperations(self._client, self._config, self._serialize, self._deserialize) self.firewall_rules = FirewallRulesOperations(self._client, self._config, self._serialize, self._deserialize) self.instance_pools = InstancePoolsOperations(self._client, self._config, self._serialize, self._deserialize) self.job_agents = JobAgentsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -875,9 +874,6 @@ def __init__( self.server_trust_certificates = ServerTrustCertificatesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.ipv6_firewall_rules = IPv6FirewallRulesOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.endpoint_certificates = EndpointCertificatesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -914,112 +910,116 @@ def __init__( self.managed_server_dns_aliases = ManagedServerDnsAliasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessment_baselines = DatabaseSqlVulnerabilityAssessmentBaselinesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.database_sql_vulnerability_assessment_execute_scan = ( - DatabaseSqlVulnerabilityAssessmentExecuteScanOperations( + self.managed_database_advanced_threat_protection_settings = ( + ManagedDatabaseAdvancedThreatProtectionSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) ) - self.database_sql_vulnerability_assessment_rule_baselines = ( - DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations( + self.managed_instance_advanced_threat_protection_settings = ( + ManagedInstanceAdvancedThreatProtectionSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) ) - self.database_sql_vulnerability_assessment_scan_result = DatabaseSqlVulnerabilityAssessmentScanResultOperations( + self.replication_links = ReplicationLinksOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessment_scans = DatabaseSqlVulnerabilityAssessmentScansOperations( + self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessments_settings = DatabaseSqlVulnerabilityAssessmentsSettingsOperations( + self.managed_instance_dtcs = ManagedInstanceDtcsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_advanced_threat_protection_settings = ( - ManagedDatabaseAdvancedThreatProtectionSettingsOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.synapse_link_workspaces = SynapseLinkWorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_advanced_threat_protection_settings = ( - ManagedInstanceAdvancedThreatProtectionSettingsOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.virtual_clusters = VirtualClustersOperations( + self._client, self._config, self._serialize, self._deserialize ) - self.replication_links = ReplicationLinksOperations( + self.instance_failover_groups = InstanceFailoverGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_baseline = SqlVulnerabilityAssessmentBaselineOperations( + self.managed_database_restore_details = ManagedDatabaseRestoreDetailsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_baselines = SqlVulnerabilityAssessmentBaselinesOperations( + self.database_encryption_protectors = DatabaseEncryptionProtectorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_execute_scan = SqlVulnerabilityAssessmentExecuteScanOperations( + self.managed_databases = ManagedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_rule_baseline = SqlVulnerabilityAssessmentRuleBaselineOperations( + self.managed_instances = ManagedInstancesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_rule_baselines = SqlVulnerabilityAssessmentRuleBaselinesOperations( + self.managed_ledger_digest_uploads = ManagedLedgerDigestUploadsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_scan_result = SqlVulnerabilityAssessmentScanResultOperations( + self.recoverable_databases = RecoverableDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_scans = SqlVulnerabilityAssessmentScansOperations( + self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessments_settings = SqlVulnerabilityAssessmentsSettingsOperations( + self.server_configuration_options = ServerConfigurationOptionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessments = SqlVulnerabilityAssessmentsOperations( + self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) + self.start_stop_managed_instance_schedules = StartStopManagedInstanceSchedulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations( + self.transparent_data_encryptions = TransparentDataEncryptionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_dtcs = ManagedInstanceDtcsOperations( + self.failover_groups = FailoverGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.ipv6_firewall_rules = IPv6FirewallRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.synapse_link_workspaces = SynapseLinkWorkspacesOperations( + self.sql_vulnerability_assessment_baseline = SqlVulnerabilityAssessmentBaselineOperations( self._client, self._config, self._serialize, self._deserialize ) - self.virtual_clusters = VirtualClustersOperations( + self.sql_vulnerability_assessment_baselines = SqlVulnerabilityAssessmentBaselinesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.instance_failover_groups = InstanceFailoverGroupsOperations( + self.sql_vulnerability_assessment_execute_scan = SqlVulnerabilityAssessmentExecuteScanOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_restore_details = ManagedDatabaseRestoreDetailsOperations( + self.sql_vulnerability_assessment_rule_baseline = SqlVulnerabilityAssessmentRuleBaselineOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_encryption_protectors = DatabaseEncryptionProtectorsOperations( + self.sql_vulnerability_assessment_rule_baselines = SqlVulnerabilityAssessmentRuleBaselinesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_databases = ManagedDatabasesOperations( + self.sql_vulnerability_assessment_scan_result = SqlVulnerabilityAssessmentScanResultOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instances = ManagedInstancesOperations( + self.sql_vulnerability_assessment_scans = SqlVulnerabilityAssessmentScansOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_ledger_digest_uploads = ManagedLedgerDigestUploadsOperations( + self.sql_vulnerability_assessments_settings = SqlVulnerabilityAssessmentsSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.recoverable_databases = RecoverableDatabasesOperations( + self.sql_vulnerability_assessments = SqlVulnerabilityAssessmentsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( + self.database_sql_vulnerability_assessment_baselines = DatabaseSqlVulnerabilityAssessmentBaselinesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_configuration_options = ServerConfigurationOptionsOperations( + self.database_sql_vulnerability_assessment_execute_scan = ( + DatabaseSqlVulnerabilityAssessmentExecuteScanOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.database_sql_vulnerability_assessment_rule_baselines = ( + DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.database_sql_vulnerability_assessment_scan_result = DatabaseSqlVulnerabilityAssessmentScanResultOperations( self._client, self._config, self._serialize, self._deserialize ) - self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) - self.start_stop_managed_instance_schedules = StartStopManagedInstanceSchedulesOperations( + self.database_sql_vulnerability_assessment_scans = DatabaseSqlVulnerabilityAssessmentScansOperations( self._client, self._config, self._serialize, self._deserialize ) - self.transparent_data_encryptions = TransparentDataEncryptionsOperations( + self.database_sql_vulnerability_assessments_settings = DatabaseSqlVulnerabilityAssessmentsSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) 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 33bbcd0f5f26..42ddd4730389 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.0b10" +VERSION = "4.0.0b11" 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 c3f0178e2eb9..5173540a8a34 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 @@ -236,8 +236,6 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :vartype elastic_pool_operations: azure.mgmt.sql.aio.operations.ElasticPoolOperationsOperations :ivar encryption_protectors: EncryptionProtectorsOperations operations :vartype encryption_protectors: azure.mgmt.sql.aio.operations.EncryptionProtectorsOperations - :ivar failover_groups: FailoverGroupsOperations operations - :vartype failover_groups: azure.mgmt.sql.aio.operations.FailoverGroupsOperations :ivar firewall_rules: FirewallRulesOperations operations :vartype firewall_rules: azure.mgmt.sql.aio.operations.FirewallRulesOperations :ivar instance_pools: InstancePoolsOperations operations @@ -447,8 +445,6 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :ivar server_trust_certificates: ServerTrustCertificatesOperations operations :vartype server_trust_certificates: azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations - :ivar ipv6_firewall_rules: IPv6FirewallRulesOperations operations - :vartype ipv6_firewall_rules: azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations :ivar endpoint_certificates: EndpointCertificatesOperations operations :vartype endpoint_certificates: azure.mgmt.sql.aio.operations.EndpointCertificatesOperations :ivar managed_database_sensitivity_labels: ManagedDatabaseSensitivityLabelsOperations @@ -489,30 +485,6 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :ivar managed_server_dns_aliases: ManagedServerDnsAliasesOperations operations :vartype managed_server_dns_aliases: azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations - :ivar database_sql_vulnerability_assessment_baselines: - DatabaseSqlVulnerabilityAssessmentBaselinesOperations operations - :vartype database_sql_vulnerability_assessment_baselines: - azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations - :ivar database_sql_vulnerability_assessment_execute_scan: - DatabaseSqlVulnerabilityAssessmentExecuteScanOperations operations - :vartype database_sql_vulnerability_assessment_execute_scan: - azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations - :ivar database_sql_vulnerability_assessment_rule_baselines: - DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations operations - :vartype database_sql_vulnerability_assessment_rule_baselines: - azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations - :ivar database_sql_vulnerability_assessment_scan_result: - DatabaseSqlVulnerabilityAssessmentScanResultOperations operations - :vartype database_sql_vulnerability_assessment_scan_result: - azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations - :ivar database_sql_vulnerability_assessment_scans: - DatabaseSqlVulnerabilityAssessmentScansOperations operations - :vartype database_sql_vulnerability_assessment_scans: - azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScansOperations - :ivar database_sql_vulnerability_assessments_settings: - DatabaseSqlVulnerabilityAssessmentsSettingsOperations operations - :vartype database_sql_vulnerability_assessments_settings: - azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations :ivar managed_database_advanced_threat_protection_settings: ManagedDatabaseAdvancedThreatProtectionSettingsOperations operations :vartype managed_database_advanced_threat_protection_settings: @@ -523,40 +495,6 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations :ivar replication_links: ReplicationLinksOperations operations :vartype replication_links: azure.mgmt.sql.aio.operations.ReplicationLinksOperations - :ivar sql_vulnerability_assessment_baseline: SqlVulnerabilityAssessmentBaselineOperations - operations - :vartype sql_vulnerability_assessment_baseline: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselineOperations - :ivar sql_vulnerability_assessment_baselines: SqlVulnerabilityAssessmentBaselinesOperations - operations - :vartype sql_vulnerability_assessment_baselines: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselinesOperations - :ivar sql_vulnerability_assessment_execute_scan: - SqlVulnerabilityAssessmentExecuteScanOperations operations - :vartype sql_vulnerability_assessment_execute_scan: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentExecuteScanOperations - :ivar sql_vulnerability_assessment_rule_baseline: - SqlVulnerabilityAssessmentRuleBaselineOperations operations - :vartype sql_vulnerability_assessment_rule_baseline: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselineOperations - :ivar sql_vulnerability_assessment_rule_baselines: - SqlVulnerabilityAssessmentRuleBaselinesOperations operations - :vartype sql_vulnerability_assessment_rule_baselines: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselinesOperations - :ivar sql_vulnerability_assessment_scan_result: SqlVulnerabilityAssessmentScanResultOperations - operations - :vartype sql_vulnerability_assessment_scan_result: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScanResultOperations - :ivar sql_vulnerability_assessment_scans: SqlVulnerabilityAssessmentScansOperations operations - :vartype sql_vulnerability_assessment_scans: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScansOperations - :ivar sql_vulnerability_assessments_settings: SqlVulnerabilityAssessmentsSettingsOperations - operations - :vartype sql_vulnerability_assessments_settings: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsSettingsOperations - :ivar sql_vulnerability_assessments: SqlVulnerabilityAssessmentsOperations operations - :vartype sql_vulnerability_assessments: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsOperations :ivar managed_database_move_operations: ManagedDatabaseMoveOperationsOperations operations :vartype managed_database_move_operations: azure.mgmt.sql.aio.operations.ManagedDatabaseMoveOperationsOperations @@ -599,6 +537,68 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations :vartype transparent_data_encryptions: azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations + :ivar failover_groups: FailoverGroupsOperations operations + :vartype failover_groups: azure.mgmt.sql.aio.operations.FailoverGroupsOperations + :ivar ipv6_firewall_rules: IPv6FirewallRulesOperations operations + :vartype ipv6_firewall_rules: azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations + :ivar sql_vulnerability_assessment_baseline: SqlVulnerabilityAssessmentBaselineOperations + operations + :vartype sql_vulnerability_assessment_baseline: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselineOperations + :ivar sql_vulnerability_assessment_baselines: SqlVulnerabilityAssessmentBaselinesOperations + operations + :vartype sql_vulnerability_assessment_baselines: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselinesOperations + :ivar sql_vulnerability_assessment_execute_scan: + SqlVulnerabilityAssessmentExecuteScanOperations operations + :vartype sql_vulnerability_assessment_execute_scan: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentExecuteScanOperations + :ivar sql_vulnerability_assessment_rule_baseline: + SqlVulnerabilityAssessmentRuleBaselineOperations operations + :vartype sql_vulnerability_assessment_rule_baseline: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselineOperations + :ivar sql_vulnerability_assessment_rule_baselines: + SqlVulnerabilityAssessmentRuleBaselinesOperations operations + :vartype sql_vulnerability_assessment_rule_baselines: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselinesOperations + :ivar sql_vulnerability_assessment_scan_result: SqlVulnerabilityAssessmentScanResultOperations + operations + :vartype sql_vulnerability_assessment_scan_result: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScanResultOperations + :ivar sql_vulnerability_assessment_scans: SqlVulnerabilityAssessmentScansOperations operations + :vartype sql_vulnerability_assessment_scans: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScansOperations + :ivar sql_vulnerability_assessments_settings: SqlVulnerabilityAssessmentsSettingsOperations + operations + :vartype sql_vulnerability_assessments_settings: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsSettingsOperations + :ivar sql_vulnerability_assessments: SqlVulnerabilityAssessmentsOperations operations + :vartype sql_vulnerability_assessments: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsOperations + :ivar database_sql_vulnerability_assessment_baselines: + DatabaseSqlVulnerabilityAssessmentBaselinesOperations operations + :vartype database_sql_vulnerability_assessment_baselines: + azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations + :ivar database_sql_vulnerability_assessment_execute_scan: + DatabaseSqlVulnerabilityAssessmentExecuteScanOperations operations + :vartype database_sql_vulnerability_assessment_execute_scan: + azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations + :ivar database_sql_vulnerability_assessment_rule_baselines: + DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations operations + :vartype database_sql_vulnerability_assessment_rule_baselines: + azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations + :ivar database_sql_vulnerability_assessment_scan_result: + DatabaseSqlVulnerabilityAssessmentScanResultOperations operations + :vartype database_sql_vulnerability_assessment_scan_result: + azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations + :ivar database_sql_vulnerability_assessment_scans: + DatabaseSqlVulnerabilityAssessmentScansOperations operations + :vartype database_sql_vulnerability_assessment_scans: + azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScansOperations + :ivar database_sql_vulnerability_assessments_settings: + DatabaseSqlVulnerabilityAssessmentsSettingsOperations operations + :vartype database_sql_vulnerability_assessments_settings: + azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription ID that identifies an Azure subscription. Required. @@ -687,7 +687,6 @@ def __init__( self.encryption_protectors = EncryptionProtectorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.failover_groups = FailoverGroupsOperations(self._client, self._config, self._serialize, self._deserialize) self.firewall_rules = FirewallRulesOperations(self._client, self._config, self._serialize, self._deserialize) self.instance_pools = InstancePoolsOperations(self._client, self._config, self._serialize, self._deserialize) self.job_agents = JobAgentsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -881,9 +880,6 @@ def __init__( self.server_trust_certificates = ServerTrustCertificatesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.ipv6_firewall_rules = IPv6FirewallRulesOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.endpoint_certificates = EndpointCertificatesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -920,112 +916,116 @@ def __init__( self.managed_server_dns_aliases = ManagedServerDnsAliasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessment_baselines = DatabaseSqlVulnerabilityAssessmentBaselinesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.database_sql_vulnerability_assessment_execute_scan = ( - DatabaseSqlVulnerabilityAssessmentExecuteScanOperations( + self.managed_database_advanced_threat_protection_settings = ( + ManagedDatabaseAdvancedThreatProtectionSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) ) - self.database_sql_vulnerability_assessment_rule_baselines = ( - DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations( + self.managed_instance_advanced_threat_protection_settings = ( + ManagedInstanceAdvancedThreatProtectionSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) ) - self.database_sql_vulnerability_assessment_scan_result = DatabaseSqlVulnerabilityAssessmentScanResultOperations( + self.replication_links = ReplicationLinksOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessment_scans = DatabaseSqlVulnerabilityAssessmentScansOperations( + self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessments_settings = DatabaseSqlVulnerabilityAssessmentsSettingsOperations( + self.managed_instance_dtcs = ManagedInstanceDtcsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_advanced_threat_protection_settings = ( - ManagedDatabaseAdvancedThreatProtectionSettingsOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.synapse_link_workspaces = SynapseLinkWorkspacesOperations( + self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_advanced_threat_protection_settings = ( - ManagedInstanceAdvancedThreatProtectionSettingsOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.virtual_clusters = VirtualClustersOperations( + self._client, self._config, self._serialize, self._deserialize ) - self.replication_links = ReplicationLinksOperations( + self.instance_failover_groups = InstanceFailoverGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_baseline = SqlVulnerabilityAssessmentBaselineOperations( + self.managed_database_restore_details = ManagedDatabaseRestoreDetailsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_baselines = SqlVulnerabilityAssessmentBaselinesOperations( + self.database_encryption_protectors = DatabaseEncryptionProtectorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_execute_scan = SqlVulnerabilityAssessmentExecuteScanOperations( + self.managed_databases = ManagedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_rule_baseline = SqlVulnerabilityAssessmentRuleBaselineOperations( + self.managed_instances = ManagedInstancesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_rule_baselines = SqlVulnerabilityAssessmentRuleBaselinesOperations( + self.managed_ledger_digest_uploads = ManagedLedgerDigestUploadsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_scan_result = SqlVulnerabilityAssessmentScanResultOperations( + self.recoverable_databases = RecoverableDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_scans = SqlVulnerabilityAssessmentScansOperations( + self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessments_settings = SqlVulnerabilityAssessmentsSettingsOperations( + self.server_configuration_options = ServerConfigurationOptionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessments = SqlVulnerabilityAssessmentsOperations( + self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) + self.start_stop_managed_instance_schedules = StartStopManagedInstanceSchedulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations( + self.transparent_data_encryptions = TransparentDataEncryptionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_dtcs = ManagedInstanceDtcsOperations( + self.failover_groups = FailoverGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.ipv6_firewall_rules = IPv6FirewallRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.synapse_link_workspaces = SynapseLinkWorkspacesOperations( + self.sql_vulnerability_assessment_baseline = SqlVulnerabilityAssessmentBaselineOperations( self._client, self._config, self._serialize, self._deserialize ) - self.virtual_clusters = VirtualClustersOperations( + self.sql_vulnerability_assessment_baselines = SqlVulnerabilityAssessmentBaselinesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.instance_failover_groups = InstanceFailoverGroupsOperations( + self.sql_vulnerability_assessment_execute_scan = SqlVulnerabilityAssessmentExecuteScanOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_restore_details = ManagedDatabaseRestoreDetailsOperations( + self.sql_vulnerability_assessment_rule_baseline = SqlVulnerabilityAssessmentRuleBaselineOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_encryption_protectors = DatabaseEncryptionProtectorsOperations( + self.sql_vulnerability_assessment_rule_baselines = SqlVulnerabilityAssessmentRuleBaselinesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_databases = ManagedDatabasesOperations( + self.sql_vulnerability_assessment_scan_result = SqlVulnerabilityAssessmentScanResultOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instances = ManagedInstancesOperations( + self.sql_vulnerability_assessment_scans = SqlVulnerabilityAssessmentScansOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_ledger_digest_uploads = ManagedLedgerDigestUploadsOperations( + self.sql_vulnerability_assessments_settings = SqlVulnerabilityAssessmentsSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.recoverable_databases = RecoverableDatabasesOperations( + self.sql_vulnerability_assessments = SqlVulnerabilityAssessmentsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( + self.database_sql_vulnerability_assessment_baselines = DatabaseSqlVulnerabilityAssessmentBaselinesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_configuration_options = ServerConfigurationOptionsOperations( + self.database_sql_vulnerability_assessment_execute_scan = ( + DatabaseSqlVulnerabilityAssessmentExecuteScanOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.database_sql_vulnerability_assessment_rule_baselines = ( + DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.database_sql_vulnerability_assessment_scan_result = DatabaseSqlVulnerabilityAssessmentScanResultOperations( self._client, self._config, self._serialize, self._deserialize ) - self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) - self.start_stop_managed_instance_schedules = StartStopManagedInstanceSchedulesOperations( + self.database_sql_vulnerability_assessment_scans = DatabaseSqlVulnerabilityAssessmentScansOperations( self._client, self._config, self._serialize, self._deserialize ) - self.transparent_data_encryptions = TransparentDataEncryptionsOperations( + self.database_sql_vulnerability_assessments_settings = DatabaseSqlVulnerabilityAssessmentsSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) 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 d6642f431e59..b4dafd81fe63 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 @@ -32,7 +32,6 @@ from ._deleted_servers_operations import DeletedServersOperations from ._elastic_pool_operations_operations import ElasticPoolOperationsOperations from ._encryption_protectors_operations import EncryptionProtectorsOperations -from ._failover_groups_operations import FailoverGroupsOperations from ._firewall_rules_operations import FirewallRulesOperations from ._instance_pools_operations import InstancePoolsOperations from ._job_agents_operations import JobAgentsOperations @@ -122,7 +121,6 @@ from ._server_connection_policies_operations import ServerConnectionPoliciesOperations from ._distributed_availability_groups_operations import DistributedAvailabilityGroupsOperations from ._server_trust_certificates_operations import ServerTrustCertificatesOperations -from ._ipv6_firewall_rules_operations import IPv6FirewallRulesOperations from ._endpoint_certificates_operations import EndpointCertificatesOperations from ._managed_database_sensitivity_labels_operations import ManagedDatabaseSensitivityLabelsOperations from ._managed_database_recommended_sensitivity_labels_operations import ( @@ -137,22 +135,6 @@ from ._database_advanced_threat_protection_settings_operations import DatabaseAdvancedThreatProtectionSettingsOperations from ._server_advanced_threat_protection_settings_operations import ServerAdvancedThreatProtectionSettingsOperations from ._managed_server_dns_aliases_operations import ManagedServerDnsAliasesOperations -from ._database_sql_vulnerability_assessment_baselines_operations import ( - DatabaseSqlVulnerabilityAssessmentBaselinesOperations, -) -from ._database_sql_vulnerability_assessment_execute_scan_operations import ( - DatabaseSqlVulnerabilityAssessmentExecuteScanOperations, -) -from ._database_sql_vulnerability_assessment_rule_baselines_operations import ( - DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations, -) -from ._database_sql_vulnerability_assessment_scan_result_operations import ( - DatabaseSqlVulnerabilityAssessmentScanResultOperations, -) -from ._database_sql_vulnerability_assessment_scans_operations import DatabaseSqlVulnerabilityAssessmentScansOperations -from ._database_sql_vulnerability_assessments_settings_operations import ( - DatabaseSqlVulnerabilityAssessmentsSettingsOperations, -) from ._managed_database_advanced_threat_protection_settings_operations import ( ManagedDatabaseAdvancedThreatProtectionSettingsOperations, ) @@ -160,15 +142,6 @@ ManagedInstanceAdvancedThreatProtectionSettingsOperations, ) from ._replication_links_operations import ReplicationLinksOperations -from ._sql_vulnerability_assessment_baseline_operations import SqlVulnerabilityAssessmentBaselineOperations -from ._sql_vulnerability_assessment_baselines_operations import SqlVulnerabilityAssessmentBaselinesOperations -from ._sql_vulnerability_assessment_execute_scan_operations import SqlVulnerabilityAssessmentExecuteScanOperations -from ._sql_vulnerability_assessment_rule_baseline_operations import SqlVulnerabilityAssessmentRuleBaselineOperations -from ._sql_vulnerability_assessment_rule_baselines_operations import SqlVulnerabilityAssessmentRuleBaselinesOperations -from ._sql_vulnerability_assessment_scan_result_operations import SqlVulnerabilityAssessmentScanResultOperations -from ._sql_vulnerability_assessment_scans_operations import SqlVulnerabilityAssessmentScansOperations -from ._sql_vulnerability_assessments_settings_operations import SqlVulnerabilityAssessmentsSettingsOperations -from ._sql_vulnerability_assessments_operations import SqlVulnerabilityAssessmentsOperations from ._managed_database_move_operations_operations import ManagedDatabaseMoveOperationsOperations from ._managed_instance_dtcs_operations import ManagedInstanceDtcsOperations from ._synapse_link_workspaces_operations import SynapseLinkWorkspacesOperations @@ -185,6 +158,33 @@ from ._servers_operations import ServersOperations from ._start_stop_managed_instance_schedules_operations import StartStopManagedInstanceSchedulesOperations from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations +from ._failover_groups_operations import FailoverGroupsOperations +from ._ipv6_firewall_rules_operations import IPv6FirewallRulesOperations +from ._sql_vulnerability_assessment_baseline_operations import SqlVulnerabilityAssessmentBaselineOperations +from ._sql_vulnerability_assessment_baselines_operations import SqlVulnerabilityAssessmentBaselinesOperations +from ._sql_vulnerability_assessment_execute_scan_operations import SqlVulnerabilityAssessmentExecuteScanOperations +from ._sql_vulnerability_assessment_rule_baseline_operations import SqlVulnerabilityAssessmentRuleBaselineOperations +from ._sql_vulnerability_assessment_rule_baselines_operations import SqlVulnerabilityAssessmentRuleBaselinesOperations +from ._sql_vulnerability_assessment_scan_result_operations import SqlVulnerabilityAssessmentScanResultOperations +from ._sql_vulnerability_assessment_scans_operations import SqlVulnerabilityAssessmentScansOperations +from ._sql_vulnerability_assessments_settings_operations import SqlVulnerabilityAssessmentsSettingsOperations +from ._sql_vulnerability_assessments_operations import SqlVulnerabilityAssessmentsOperations +from ._database_sql_vulnerability_assessment_baselines_operations import ( + DatabaseSqlVulnerabilityAssessmentBaselinesOperations, +) +from ._database_sql_vulnerability_assessment_execute_scan_operations import ( + DatabaseSqlVulnerabilityAssessmentExecuteScanOperations, +) +from ._database_sql_vulnerability_assessment_rule_baselines_operations import ( + DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations, +) +from ._database_sql_vulnerability_assessment_scan_result_operations import ( + DatabaseSqlVulnerabilityAssessmentScanResultOperations, +) +from ._database_sql_vulnerability_assessment_scans_operations import DatabaseSqlVulnerabilityAssessmentScansOperations +from ._database_sql_vulnerability_assessments_settings_operations import ( + DatabaseSqlVulnerabilityAssessmentsSettingsOperations, +) from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -215,7 +215,6 @@ "DeletedServersOperations", "ElasticPoolOperationsOperations", "EncryptionProtectorsOperations", - "FailoverGroupsOperations", "FirewallRulesOperations", "InstancePoolsOperations", "JobAgentsOperations", @@ -293,7 +292,6 @@ "ServerConnectionPoliciesOperations", "DistributedAvailabilityGroupsOperations", "ServerTrustCertificatesOperations", - "IPv6FirewallRulesOperations", "EndpointCertificatesOperations", "ManagedDatabaseSensitivityLabelsOperations", "ManagedDatabaseRecommendedSensitivityLabelsOperations", @@ -306,24 +304,9 @@ "DatabaseAdvancedThreatProtectionSettingsOperations", "ServerAdvancedThreatProtectionSettingsOperations", "ManagedServerDnsAliasesOperations", - "DatabaseSqlVulnerabilityAssessmentBaselinesOperations", - "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations", - "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations", - "DatabaseSqlVulnerabilityAssessmentScanResultOperations", - "DatabaseSqlVulnerabilityAssessmentScansOperations", - "DatabaseSqlVulnerabilityAssessmentsSettingsOperations", "ManagedDatabaseAdvancedThreatProtectionSettingsOperations", "ManagedInstanceAdvancedThreatProtectionSettingsOperations", "ReplicationLinksOperations", - "SqlVulnerabilityAssessmentBaselineOperations", - "SqlVulnerabilityAssessmentBaselinesOperations", - "SqlVulnerabilityAssessmentExecuteScanOperations", - "SqlVulnerabilityAssessmentRuleBaselineOperations", - "SqlVulnerabilityAssessmentRuleBaselinesOperations", - "SqlVulnerabilityAssessmentScanResultOperations", - "SqlVulnerabilityAssessmentScansOperations", - "SqlVulnerabilityAssessmentsSettingsOperations", - "SqlVulnerabilityAssessmentsOperations", "ManagedDatabaseMoveOperationsOperations", "ManagedInstanceDtcsOperations", "SynapseLinkWorkspacesOperations", @@ -340,6 +323,23 @@ "ServersOperations", "StartStopManagedInstanceSchedulesOperations", "TransparentDataEncryptionsOperations", + "FailoverGroupsOperations", + "IPv6FirewallRulesOperations", + "SqlVulnerabilityAssessmentBaselineOperations", + "SqlVulnerabilityAssessmentBaselinesOperations", + "SqlVulnerabilityAssessmentExecuteScanOperations", + "SqlVulnerabilityAssessmentRuleBaselineOperations", + "SqlVulnerabilityAssessmentRuleBaselinesOperations", + "SqlVulnerabilityAssessmentScanResultOperations", + "SqlVulnerabilityAssessmentScansOperations", + "SqlVulnerabilityAssessmentsSettingsOperations", + "SqlVulnerabilityAssessmentsOperations", + "DatabaseSqlVulnerabilityAssessmentBaselinesOperations", + "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations", + "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations", + "DatabaseSqlVulnerabilityAssessmentScanResultOperations", + "DatabaseSqlVulnerabilityAssessmentScansOperations", + "DatabaseSqlVulnerabilityAssessmentsSettingsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_backup_short_term_retention_policies_operations.py index 1cc566a3960c..baf5f276a299 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -100,9 +96,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -161,16 +155,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "BackupShortTermRetentionPolicy") @@ -346,9 +338,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -415,16 +405,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "BackupShortTermRetentionPolicy") @@ -600,9 +588,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -672,9 +658,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.BackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 d1c87f0c52d2..79f1afce31cd 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_capabilities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_capabilities_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from ..._vendor import _convert_request from ...operations._capabilities_operations import build_list_by_location_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,9 +79,7 @@ async def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.LocationCapabilities] = kwargs.pop("cls", None) request = build_list_by_location_request( 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 3aa1e3dd0251..1bd8b41cc31b 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload @@ -169,7 +170,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) @@ -177,7 +178,7 @@ async def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DataMaskingPolicy") @@ -254,7 +255,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) 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 6879aed1e5b2..3b244ac23c73 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload @@ -182,7 +183,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DataMaskingRule] = kwargs.pop("cls", None) @@ -190,7 +191,7 @@ async def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DataMaskingRule") @@ -264,7 +265,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") cls: ClsType[_models.DataMaskingRuleListResult] = kwargs.pop("cls", None) 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 a5d9f29d6cfd..0191b59a7f49 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_warehouse_user_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_warehouse_user_activities_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._data_warehouse_user_activities_operations import build_get_request, build_list_by_database_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,9 +90,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DataWarehouseUserActivities] = kwargs.pop("cls", None) request = build_get_request( @@ -159,9 +152,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DataWarehouseUserActivitiesListResult] = kwargs.pop("cls", None) error_map = { 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 23a17b611cf7..7ae70f7855ad 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,10 +34,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,9 +80,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { @@ -186,9 +180,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( @@ -344,16 +336,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseAdvancedThreatProtection") 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 fb90631ec381..a17af91695e9 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -32,10 +32,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,9 +91,7 @@ async def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) request = build_list_by_database_request( @@ -167,9 +161,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) request = build_get_request( @@ -319,16 +311,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Advisor") 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 743fee8e3859..5e1d2ae01f0c 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from ..._vendor import _convert_request from ...operations._database_automatic_tuning_operations import build_get_request, build_update_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,9 +80,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) request = build_get_request( @@ -226,16 +220,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseAutomaticTuning") 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 8c3dd63f35c3..894f864b97f6 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload @@ -84,9 +85,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { @@ -181,9 +180,7 @@ async def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -334,16 +331,14 @@ async def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseBlobAuditingPolicy") 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 87b32a214af9..eb69b69d75a8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_columns_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_columns_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,10 +33,6 @@ build_list_by_table_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -102,9 +97,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { @@ -206,9 +199,7 @@ def list_by_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { @@ -315,9 +306,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) request = build_get_request( diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_encryption_protectors_operations.py index 32ac89b422c7..42cd2d9ffc49 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_encryption_protectors_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._database_encryption_protectors_operations import build_revalidate_request, build_revert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,9 +71,7 @@ async def _revalidate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_revalidate_request( @@ -149,9 +142,7 @@ async def begin_revalidate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -214,9 +205,7 @@ async def _revert_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_revert_request( @@ -287,9 +276,7 @@ async def begin_revert( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 e5592c777026..660949643072 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,10 +36,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,9 +90,7 @@ async def get( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_get_request( @@ -151,16 +145,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ImportExportExtensionsOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseExtensions") @@ -336,9 +328,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ImportExportExtensionsOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -408,9 +398,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.ImportExportExtensionsOperationListResult] = kwargs.pop("cls", None) error_map = { 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 db238f0ee854..0e946b0600c4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_operations_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._database_operations_operations import build_cancel_request, build_list_by_database_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,9 +83,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( @@ -146,9 +139,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.DatabaseOperationListResult] = kwargs.pop("cls", None) error_map = { 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 f74a3599c174..ab5d79c35796 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -32,10 +32,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -90,9 +86,7 @@ async def list_by_database_advisor( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[List[_models.RecommendedAction]] = kwargs.pop("cls", None) request = build_list_by_database_advisor_request( @@ -170,9 +164,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) request = build_get_request( @@ -332,16 +324,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "RecommendedAction") 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 b0fd4b60ce6f..82025cd4a25f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_schemas_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_schemas_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._database_schemas_operations import build_get_request, build_list_by_database_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,9 +81,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) error_map = { @@ -182,9 +175,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) request = build_get_request( 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 22bd8b647458..e565d0de814c 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,10 +34,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -98,9 +94,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -253,16 +247,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseSecurityAlertPolicy") @@ -334,9 +326,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSecurityAlertListResult] = kwargs.pop("cls", None) error_map = { 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 7f49e2f90207..1eadef8bd489 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,10 +34,6 @@ build_list_by_sql_vulnerability_assessment_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -92,9 +88,7 @@ def list_by_sql_vulnerability_assessment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) error_map = { @@ -199,9 +193,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) request = build_get_request( @@ -366,16 +358,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput") 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 5b5b47d44f37..0f59df266e73 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._database_sql_vulnerability_assessment_execute_scan_operations import build_execute_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,9 +71,7 @@ async def _execute_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_execute_request( @@ -149,9 +142,7 @@ async def begin_execute( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 79536949963f..4b0bccf6978f 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -35,10 +35,6 @@ build_list_by_baseline_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,9 +92,7 @@ def list_by_baseline( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) error_map = { @@ -207,9 +201,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( @@ -383,16 +375,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput") @@ -481,9 +471,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 fd95e921cbe1..4e67ac0cc349 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scan_result_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scan_result_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -33,10 +32,6 @@ build_list_by_scan_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +61,7 @@ def list_by_scan( resource_group_name: str, server_name: str, database_name: str, - vulnerability_assessment_name: Union[str, _models.SQLVulnerabilityAssessmentName], + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], scan_id: str, **kwargs: Any ) -> AsyncIterable["_models.SqlVulnerabilityAssessmentScanResults"]: @@ -82,7 +77,7 @@ def list_by_scan( :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" Required. :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SQLVulnerabilityAssessmentName + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. Required. :type scan_id: str @@ -96,9 +91,7 @@ def list_by_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) error_map = { @@ -168,7 +161,7 @@ async def get( resource_group_name: str, server_name: str, database_name: str, - vulnerability_assessment_name: Union[str, _models.SQLVulnerabilityAssessmentName], + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], scan_id: str, scan_result_id: str, **kwargs: Any @@ -185,7 +178,7 @@ async def get( :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" Required. :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SQLVulnerabilityAssessmentName + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. Required. :type scan_id: str @@ -207,9 +200,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) request = build_get_request( 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 633af5b123fd..f93531d3c137 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scans_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -33,10 +32,6 @@ build_list_by_sql_vulnerability_assessments_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,9 +86,7 @@ def list_by_sql_vulnerability_assessments( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { @@ -196,9 +189,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( 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 7783234209b2..9ecd4d24a337 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessments_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessments_settings_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -33,10 +32,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,9 +78,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { @@ -185,9 +178,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( 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 e5f1f186eab1..112b45bb5cde 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_tables_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_tables_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._database_tables_operations import build_get_request, build_list_by_schema_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,9 +84,7 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) error_map = { @@ -194,9 +187,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) request = build_get_request( 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 b3cc39873b22..fde4eb753fe5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_usages_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,10 +28,6 @@ from ..._vendor import _convert_request from ...operations._database_usages_operations import build_list_by_database_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,9 +72,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.DatabaseUsageListResult] = kwargs.pop("cls", None) error_map = { 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 9289b9df0561..3eba1658759e 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -32,10 +32,6 @@ build_get_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -105,9 +101,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( @@ -289,16 +283,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseVulnerabilityAssessmentRuleBaseline") @@ -390,9 +382,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 3b8634254384..342f19229fd6 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_scans_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +36,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,9 +79,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_initiate_scan_request( @@ -161,9 +154,7 @@ async def begin_initiate_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -237,9 +228,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { @@ -342,9 +331,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( @@ -424,9 +411,7 @@ async def export( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) request = build_export_request( 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 1a5b7d6941e7..0f7bbb31f6a9 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -35,10 +35,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -100,9 +96,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( @@ -258,16 +252,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseVulnerabilityAssessment") @@ -353,9 +345,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -414,9 +404,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 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 3188f24a90c2..dcf3bcbb7452 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -49,10 +49,6 @@ build_upgrade_data_warehouse_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -100,7 +96,7 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { @@ -184,7 +180,7 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -267,9 +263,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { @@ -371,9 +365,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.Database] = kwargs.pop("cls", None) request = build_get_request( @@ -432,16 +424,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Database") @@ -607,9 +597,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Database] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -672,9 +660,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -736,9 +722,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -800,16 +784,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseUpdate") @@ -972,9 +954,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Database] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1041,16 +1021,14 @@ async def _export_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ExportDatabaseDefinition") @@ -1213,9 +1191,7 @@ async def begin_export( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ImportExportOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1280,9 +1256,7 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( @@ -1353,9 +1327,7 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1416,16 +1388,14 @@ async def _import_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ImportExistingDatabaseDefinition") @@ -1588,9 +1558,7 @@ async def begin_import_method( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ImportExportOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1738,16 +1706,14 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ResourceMoveDefinition") @@ -1800,9 +1766,7 @@ async def _pause_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) request = build_pause_request( @@ -1871,9 +1835,7 @@ async def begin_pause( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-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) @@ -1930,9 +1892,7 @@ async def _resume_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) request = build_resume_request( @@ -2001,9 +1961,7 @@ async def begin_resume( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-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) @@ -2060,9 +2018,7 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_upgrade_data_warehouse_request( @@ -2124,9 +2080,7 @@ async def begin_upgrade_data_warehouse( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2188,9 +2142,7 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { @@ -2271,9 +2223,7 @@ def list_inaccessible_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { 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 d314d8659ba8..03bfa370d9b9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_deleted_servers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_deleted_servers_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +36,6 @@ build_recover_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,9 +71,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DeletedServer"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) error_map = { @@ -159,9 +152,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DeletedServer] = kwargs.pop("cls", None) request = build_get_request( @@ -212,9 +203,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) error_map = { @@ -288,9 +277,7 @@ async def _recover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[Optional[_models.DeletedServer]] = kwargs.pop("cls", None) request = build_recover_request( @@ -355,9 +342,7 @@ async def begin_recover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DeletedServer] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_distributed_availability_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_distributed_availability_groups_operations.py index 5895167c3c64..665f0f754a65 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,10 +38,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,9 +82,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DistributedAvailabilityGroupsListResult] = kwargs.pop("cls", None) error_map = { @@ -182,9 +176,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) request = build_get_request( @@ -241,16 +233,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DistributedAvailabilityGroup") @@ -416,9 +406,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -482,9 +470,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -550,9 +536,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -612,16 +596,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DistributedAvailabilityGroup") @@ -784,9 +766,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) 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 c0cfe703ce7e..d290a62bb471 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_activities_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,10 +28,6 @@ from ..._vendor import _convert_request from ...operations._elastic_pool_activities_operations import build_list_by_elastic_pool_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,7 +73,7 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ElasticPoolActivityListResult] = kwargs.pop("cls", None) error_map = { 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 1d7f4adaa373..f96cb4b20ca2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_database_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_database_activities_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,10 +28,6 @@ from ..._vendor import _convert_request from ...operations._elastic_pool_database_activities_operations import build_list_by_elastic_pool_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +74,7 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ElasticPoolDatabaseActivityListResult] = kwargs.pop("cls", None) error_map = { 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 c5cd6fa7eaa7..48dff0581c25 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_operations_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._elastic_pool_operations_operations import build_cancel_request, build_list_by_elastic_pool_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,9 +83,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( @@ -147,9 +140,7 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ElasticPoolOperationListResult] = kwargs.pop("cls", None) error_map = { 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 afeb6c1a4a97..c07625441acf 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,10 +41,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -92,7 +88,7 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { @@ -176,7 +172,7 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -259,9 +255,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ElasticPoolListResult] = kwargs.pop("cls", None) error_map = { @@ -352,9 +346,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) request = build_get_request( @@ -411,16 +403,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ElasticPool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ElasticPool") @@ -586,9 +576,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -651,9 +639,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -715,9 +701,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -779,16 +763,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ElasticPool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ElasticPoolUpdate") @@ -951,9 +933,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1015,9 +995,7 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( @@ -1079,9 +1057,7 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 865a9136621e..91c6399eef34 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_revalidate_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,9 +79,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.EncryptionProtectorListResult] = kwargs.pop("cls", None) error_map = { @@ -180,9 +174,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.EncryptionProtector] = kwargs.pop("cls", None) request = build_get_request( @@ -239,16 +231,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.EncryptionProtector]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "EncryptionProtector") @@ -414,9 +404,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.EncryptionProtector] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -480,9 +468,7 @@ async def _revalidate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_revalidate_request( @@ -549,9 +535,7 @@ async def begin_revalidate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 ab6a50c0ef77..b77ac4eb8a7b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_endpoint_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_endpoint_certificates_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._endpoint_certificates_operations import build_get_request, build_list_by_instance_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,9 +71,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.EndpointCertificateListResult] = kwargs.pop("cls", None) error_map = { @@ -169,9 +162,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.EndpointCertificate] = kwargs.pop("cls", None) request = build_get_request( 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 7a8ca6e374f6..7336f1f554a2 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload @@ -84,9 +85,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { @@ -181,9 +180,7 @@ async def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -334,16 +331,14 @@ async def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ExtendedDatabaseBlobAuditingPolicy") 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 519b8f39f572..1d13749e1626 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload @@ -84,9 +85,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ExtendedServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { @@ -178,9 +177,7 @@ async def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -237,16 +234,14 @@ async def _create_or_update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ExtendedServerBlobAuditingPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ExtendedServerBlobAuditingPolicy") @@ -413,9 +408,7 @@ async def begin_create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_failover_groups_operations.py index a451c8fd648d..5a7d32428bb1 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,13 +37,10 @@ build_force_failover_allow_data_loss_request, build_get_request, build_list_by_server_request, + build_try_planned_before_forced_failover_request, build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,6 +64,86 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncIterable["_models.FailoverGroup"]: + """Lists the failover groups in a server. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param server_name: The name of the server containing the failover group. Required. + :type server_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FailoverGroup or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + cls: ClsType[_models.FailoverGroupListResult] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_server.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + request = HttpRequest("GET", next_link) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("FailoverGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups" + } + @distributed_trace_async async def get( self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any @@ -96,9 +173,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) request = build_get_request( @@ -155,16 +230,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) 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 _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "FailoverGroup") @@ -330,9 +403,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -392,9 +463,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -456,9 +525,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -518,16 +585,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) 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 _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "FailoverGroupUpdate") @@ -690,9 +755,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -738,88 +801,6 @@ def get_long_running_output(pipeline_response): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" } - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncIterable["_models.FailoverGroup"]: - """Lists the failover groups in a server. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. Required. - :type resource_group_name: str - :param server_name: The name of the server containing the failover group. Required. - :type server_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FailoverGroup or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.FailoverGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) - cls: ClsType[_models.FailoverGroupListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_server.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - request = HttpRequest("GET", next_link) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FailoverGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - 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 ) -> Optional[_models.FailoverGroup]: @@ -834,9 +815,7 @@ async def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) request = build_failover_request( @@ -905,9 +884,7 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -964,9 +941,7 @@ async def _force_failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) request = build_force_failover_allow_data_loss_request( @@ -1036,9 +1011,7 @@ async def begin_force_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1080,3 +1053,136 @@ def get_long_running_output(pipeline_response): begin_force_failover_allow_data_loss.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" } + + async def _try_planned_before_forced_failover_initial( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> Optional[_models.FailoverGroup]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) + + request = build_try_planned_before_forced_failover_request( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._try_planned_before_forced_failover_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("FailoverGroup", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _try_planned_before_forced_failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/tryPlannedBeforeForcedFailover" + } + + @distributed_trace_async + async def begin_try_planned_before_forced_failover( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverGroup]: + """Fails over from the current primary server to this server. This operation tries planned before + forced failover but might still result in data loss. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either FailoverGroup or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._try_planned_before_forced_failover_initial( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FailoverGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_try_planned_before_forced_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/tryPlannedBeforeForcedFailover" + } 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 bbb3fc8fd00c..d9ea93255425 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,10 +36,6 @@ build_replace_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -92,9 +88,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) request = build_get_request( @@ -234,16 +228,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "FirewallRule") @@ -319,9 +311,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -374,9 +364,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.FirewallRuleListResult] = kwargs.pop("cls", None) error_map = { @@ -525,16 +513,14 @@ async def replace( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.FirewallRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "FirewallRuleList") 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 2bad7107fed4..a08cba5f9dd9 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,10 +34,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -174,14 +170,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "GeoBackupPolicy") @@ -265,7 +261,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -325,7 +321,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.GeoBackupPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 6df6edda98f4..1997b5885694 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,10 +39,6 @@ build_list_by_location_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,9 +82,7 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.InstanceFailoverGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -178,9 +172,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) request = build_get_request( @@ -237,16 +229,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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.InstanceFailoverGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "InstanceFailoverGroup") @@ -412,9 +402,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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.InstanceFailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -474,9 +462,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -538,9 +524,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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) @@ -595,9 +579,7 @@ async def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[Optional[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) request = build_failover_request( @@ -666,9 +648,7 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) 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) @@ -725,9 +705,7 @@ async def _force_failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[Optional[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) request = build_force_failover_allow_data_loss_request( @@ -797,9 +775,7 @@ async def begin_force_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pools_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pools_operations.py index 788d9354ca56..413b56a94bee 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,10 +39,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,9 +87,7 @@ async def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) request = build_get_request( @@ -148,16 +142,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.InstancePool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "InstancePool") @@ -313,9 +305,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -374,9 +364,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -435,9 +423,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -495,16 +481,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.InstancePool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "InstancePoolUpdate") @@ -657,9 +641,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -719,9 +701,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) error_map = { @@ -793,9 +773,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.InstancePool"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) error_map = { 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 51db6b158d75..ba45e5f4526b 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -35,10 +35,6 @@ build_list_by_server_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,9 +77,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.IPv6FirewallRuleListResult] = kwargs.pop("cls", None) error_map = { @@ -173,9 +167,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) request = build_get_request( @@ -317,16 +309,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "IPv6FirewallRule") @@ -402,9 +392,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 93a36076ee21..4290e859dff1 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,10 +38,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,9 +80,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobAgentListResult] = kwargs.pop("cls", None) error_map = { @@ -176,9 +170,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) request = build_get_request( @@ -235,16 +227,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.JobAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "JobAgent") @@ -410,9 +400,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -472,9 +460,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -536,9 +522,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -598,16 +582,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.JobAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "JobAgentUpdate") @@ -770,9 +752,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_credentials_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_credentials_operations.py index c0116ac64c3c..200c2abb26d9 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -35,10 +35,6 @@ build_list_by_agent_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,9 +79,7 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobCredentialListResult] = kwargs.pop("cls", None) error_map = { @@ -178,9 +172,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) request = build_get_request( @@ -330,16 +322,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "JobCredential") @@ -418,9 +408,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 fa7f64e7457b..71e8ba3c9810 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_executions_operations.py @@ -7,7 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,10 +39,6 @@ build_list_by_job_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -118,9 +113,7 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { @@ -228,9 +221,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( @@ -280,9 +271,7 @@ async def _create_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[Optional[_models.JobExecution]] = kwargs.pop("cls", None) request = build_create_request( @@ -354,9 +343,7 @@ async def begin_create( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) 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) @@ -454,9 +441,7 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { @@ -565,9 +550,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( @@ -627,9 +610,7 @@ async def _create_or_update_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[Optional[_models.JobExecution]] = kwargs.pop("cls", None) request = build_create_or_update_request( @@ -713,9 +694,7 @@ async def begin_create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) 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) 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 4c1c56dfbedc..22a6209d8d51 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_step_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_step_executions_operations.py @@ -7,7 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -31,10 +30,6 @@ from ..._vendor import _convert_request from ...operations._job_step_executions_operations import build_get_request, build_list_by_job_execution_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -115,9 +110,7 @@ def list_by_job_execution( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { @@ -230,9 +223,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( 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 aafe5afda201..d0031e81a0d8 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_version_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,9 +91,7 @@ def list_by_version( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) error_map = { @@ -203,9 +197,7 @@ async def get_by_version( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) request = build_get_by_version_request( @@ -269,9 +261,7 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) error_map = { @@ -373,9 +363,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) request = build_get_request( @@ -535,16 +523,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "JobStep") @@ -632,9 +618,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 6710782d64ee..c169dece87fc 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_executions_operations.py @@ -7,7 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -35,10 +34,6 @@ build_list_by_step_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -119,9 +114,7 @@ def list_by_job_execution( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { @@ -252,9 +245,7 @@ def list_by_step( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { @@ -371,9 +362,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( 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 29579d388ca8..01039b7310f9 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -35,10 +35,6 @@ build_list_by_agent_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,9 +79,7 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobTargetGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -178,9 +172,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) request = build_get_request( @@ -330,16 +322,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "JobTargetGroup") @@ -418,9 +408,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 a486c0b1a245..f8c2b538e26d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_versions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_versions_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._job_versions_operations import build_get_request, build_list_by_job_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,9 +75,7 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobVersionListResult] = kwargs.pop("cls", None) error_map = { @@ -184,9 +177,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobVersion] = kwargs.pop("cls", None) request = build_get_request( 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 7bf28b2c1506..56123e9f06ce 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -35,10 +35,6 @@ build_list_by_agent_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,9 +79,7 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobListResult] = kwargs.pop("cls", None) error_map = { @@ -178,9 +172,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.Job] = kwargs.pop("cls", None) request = build_get_request( @@ -329,16 +321,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Job] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Job") @@ -417,9 +407,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 f77f516b04bd..6f65e42ac581 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -100,9 +96,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) request = build_get_request( @@ -161,16 +155,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.LedgerDigestUploads]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "LedgerDigestUploads") @@ -345,9 +337,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -415,9 +405,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.LedgerDigestUploadsListResult] = kwargs.pop("cls", None) error_map = { @@ -498,9 +486,7 @@ async def _disable_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[Optional[_models.LedgerDigestUploads]] = kwargs.pop("cls", None) request = build_disable_request( @@ -578,9 +564,7 @@ async def begin_disable( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py index 259d98d17514..8a226562f3eb 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -47,10 +47,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,16 +90,14 @@ async def _copy_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CopyLongTermRetentionBackupParameters") @@ -276,9 +270,7 @@ async def begin_copy( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackupOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -345,16 +337,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "UpdateLongTermRetentionBackupParameters") @@ -527,9 +517,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackupOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -611,9 +599,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_request( @@ -671,9 +657,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -742,9 +726,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-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) @@ -819,9 +801,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -912,9 +892,7 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -1006,9 +984,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -1092,16 +1068,14 @@ 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: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CopyLongTermRetentionBackupParameters") @@ -1287,9 +1261,7 @@ async def begin_copy_by_resource_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackupOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1358,16 +1330,14 @@ 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: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "UpdateLongTermRetentionBackupParameters") @@ -1553,9 +1523,7 @@ async def begin_update_by_resource_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackupOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1642,9 +1610,7 @@ async def get_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_by_resource_group_request( @@ -1704,9 +1670,7 @@ 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: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_by_resource_group_request( @@ -1780,9 +1744,7 @@ async def begin_delete_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-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) @@ -1862,9 +1824,7 @@ def list_by_resource_group_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -1960,9 +1920,7 @@ def list_by_resource_group_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -2059,9 +2017,7 @@ def list_by_resource_group_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 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 85012505e418..39d74d7f1e77 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_managed_instance_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_managed_instance_backups_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -43,10 +42,6 @@ build_list_by_resource_group_location_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -100,9 +95,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_request( @@ -155,9 +148,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -221,9 +212,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-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) @@ -299,9 +288,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -396,9 +383,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -489,9 +474,7 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -592,9 +575,7 @@ async def get_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_by_resource_group_request( @@ -654,9 +635,7 @@ 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: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_by_resource_group_request( @@ -730,9 +709,7 @@ async def begin_delete_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-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) @@ -813,9 +790,7 @@ def list_by_resource_group_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -915,9 +890,7 @@ def list_by_resource_group_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -1013,9 +986,7 @@ def list_by_resource_group_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 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 59d9a4c5611f..149a64360d15 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,10 +36,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -99,9 +95,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.LongTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -160,16 +154,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.LongTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "LongTermRetentionPolicy") @@ -342,9 +334,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -413,9 +403,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.LongTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 5f720f1dbfbd..1eb83b9c3cbb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_window_options_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_window_options_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from ..._vendor import _convert_request from ...operations._maintenance_window_options_operations import build_get_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -92,9 +87,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.MaintenanceWindowOptions] = kwargs.pop("cls", None) request = build_get_request( 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 da338c0cfaf5..187b4e6ca77f 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from ..._vendor import _convert_request from ...operations._maintenance_windows_operations import build_create_or_update_request, build_get_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,9 +87,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.MaintenanceWindows] = kwargs.pop("cls", None) request = build_get_request( @@ -242,16 +236,14 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "MaintenanceWindows") 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 0effa797cb04..d36198c9b212 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -100,9 +96,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -161,16 +155,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedBackupShortTermRetentionPolicy") @@ -346,9 +338,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -415,16 +405,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedBackupShortTermRetentionPolicy") @@ -600,9 +588,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -672,9 +658,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 5044e4f4f2e2..c29dad77ad40 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,10 +34,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,9 +80,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { @@ -186,9 +180,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( @@ -344,16 +336,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedDatabaseAdvancedThreatProtection") 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 5868dcaf0d54..21f3871edb69 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_columns_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_columns_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, List, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,10 +33,6 @@ build_list_by_table_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -102,9 +97,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { @@ -206,9 +199,7 @@ def list_by_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { @@ -315,9 +306,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) request = build_get_request( 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 a73c5644bc08..ee79a0cc63ad 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_move_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_move_operations_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._managed_database_move_operations_operations import build_get_request, build_list_by_location_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,9 +84,7 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.ManagedDatabaseMoveOperationListResult] = kwargs.pop("cls", None) error_map = { @@ -183,9 +176,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.ManagedDatabaseMoveOperationResult] = kwargs.pop("cls", None) request = build_get_request( 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 5c2b2a1e467d..d9816ad3c3b8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_queries_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_queries_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._managed_database_queries_operations import build_get_request, build_list_by_query_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,9 +83,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceQuery] = kwargs.pop("cls", None) request = build_get_request( @@ -167,9 +160,7 @@ def list_by_query( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceQueryStatistics] = kwargs.pop("cls", None) error_map = { 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 f9bd6d46071f..1c80504b76d6 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from ..._vendor import _convert_request from ...operations._managed_database_recommended_sensitivity_labels_operations import build_update_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -157,16 +153,14 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "RecommendedSensitivityLabelUpdateList") 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 a40e9729daf4..116741dcf95b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_restore_details_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_restore_details_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from ..._vendor import _convert_request from ...operations._managed_database_restore_details_operations import build_get_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -91,9 +86,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.ManagedDatabaseRestoreDetailsResult] = kwargs.pop("cls", None) request = build_get_request( 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 e416ff78f703..91c289b3a1dd 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_schemas_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_schemas_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._managed_database_schemas_operations import build_get_request, build_list_by_database_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,9 +81,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) error_map = { @@ -182,9 +175,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) request = build_get_request( 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 8a03d94c5eb1..338908aca31e 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,10 +34,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -98,9 +94,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -253,16 +247,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedDatabaseSecurityAlertPolicy") @@ -334,9 +326,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 ae163aad96a0..b13c4c82cc96 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_events_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_events_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,10 +28,6 @@ from ..._vendor import _convert_request from ...operations._managed_database_security_events_operations import build_list_by_database_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,9 +91,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SecurityEventCollection] = kwargs.pop("cls", None) error_map = { 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 d7dafd7c56c1..484f86a80b48 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload @@ -112,9 +113,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) request = build_get_request( @@ -295,16 +294,14 @@ async def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SensitivityLabel") @@ -401,9 +398,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -487,9 +482,7 @@ async def disable_recommendation( # pylint: disable=inconsistent-return-stateme _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) 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") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_disable_recommendation_request( @@ -574,9 +567,7 @@ async def enable_recommendation( # pylint: disable=inconsistent-return-statemen _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) 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") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_enable_recommendation_request( @@ -649,9 +640,7 @@ def list_current_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { @@ -817,16 +806,14 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SensitivityLabelUpdateList") @@ -901,9 +888,7 @@ def list_recommended_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 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 80cd58d73f50..991583ca043f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_tables_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_tables_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._managed_database_tables_operations import build_get_request, build_list_by_schema_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,9 +84,7 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) error_map = { @@ -194,9 +187,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) request = build_get_request( 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 636160cdeeda..e535f3b6b8b1 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,10 +34,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -98,9 +94,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) request = build_get_request( @@ -253,16 +247,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedTransparentDataEncryption") @@ -334,9 +326,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedTransparentDataEncryptionListResult] = kwargs.pop("cls", None) error_map = { 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 aa03c3f9f9ef..53c3b94aed6c 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -32,10 +32,6 @@ build_get_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -105,9 +101,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( @@ -289,16 +283,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseVulnerabilityAssessmentRuleBaseline") @@ -390,9 +382,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 481ad75ebad0..d93cbebab65b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_scans_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +36,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,9 +79,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_initiate_scan_request( @@ -161,9 +154,7 @@ async def begin_initiate_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -246,9 +237,7 @@ async def export( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) request = build_export_request( @@ -323,9 +312,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { @@ -428,9 +415,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( 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 69f242e74110..90db21a6056e 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -35,10 +35,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -100,9 +96,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( @@ -258,16 +252,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseVulnerabilityAssessment") @@ -353,9 +345,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -414,9 +404,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 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 292764db4794..de7818d9588b 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -43,10 +43,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,9 +85,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { @@ -181,9 +175,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( @@ -240,16 +232,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedDatabase]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedDatabase") @@ -415,9 +405,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -477,9 +465,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -541,9 +527,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -603,16 +587,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedDatabase]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedDatabaseUpdate") @@ -775,9 +757,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -842,16 +822,14 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedDatabaseMoveDefinition") @@ -1005,9 +983,7 @@ async def begin_cancel_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1070,16 +1046,14 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedDatabaseMoveDefinition") @@ -1233,9 +1207,7 @@ async def begin_complete_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1298,16 +1270,14 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CompleteDatabaseRestoreDefinition") @@ -1463,9 +1433,7 @@ async def begin_complete_restore( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1528,16 +1496,14 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedDatabaseStartMoveDefinition") @@ -1691,9 +1657,7 @@ async def begin_start_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1756,9 +1720,7 @@ def list_inaccessible_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 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 306a6ed01d6d..553633be8c81 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_instance_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,9 +81,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceAdministratorListResult] = kwargs.pop("cls", None) error_map = { @@ -181,9 +175,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceAdministrator] = kwargs.pop("cls", None) request = build_get_request( @@ -240,16 +232,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstanceAdministrator]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceAdministrator") @@ -415,9 +405,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceAdministrator] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -481,9 +469,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -549,9 +535,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 e97970d29f5d..fb599ad37d3f 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,10 +36,6 @@ build_list_by_instance_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,9 +80,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ManagedInstanceAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { @@ -182,9 +176,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( @@ -241,16 +233,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) 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 _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceAdvancedThreatProtection") @@ -422,9 +412,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_azure_ad_only_authentications_operations.py index 271c989fdfe0..2e98d3f7c432 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_instance_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -98,9 +94,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = kwargs.pop("cls", None) request = build_get_request( @@ -157,16 +151,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstanceAzureADOnlyAuthentication]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceAzureADOnlyAuthentication") @@ -344,9 +336,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -410,9 +400,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -479,9 +467,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -543,9 +529,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] = kwargs.pop("cls", None) error_map = { 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 561e377fe259..481677f2a479 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,10 +36,6 @@ build_list_by_managed_instance_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,9 +78,7 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.ManagedInstanceDtcListResult] = kwargs.pop("cls", None) error_map = { @@ -174,9 +168,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) request = build_get_request( @@ -233,16 +225,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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.ManagedInstanceDtc] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceDtc") @@ -403,9 +393,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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.ManagedInstanceDtc] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_encryption_protectors_operations.py index b7b1deb30777..339ffbc022b7 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_revalidate_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,9 +78,7 @@ async def _revalidate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_revalidate_request( @@ -151,9 +145,7 @@ async def begin_revalidate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -215,9 +207,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceEncryptionProtectorListResult] = kwargs.pop("cls", None) error_map = { @@ -312,9 +302,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceEncryptionProtector] = kwargs.pop("cls", None) request = build_get_request( @@ -371,16 +359,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstanceEncryptionProtector]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceEncryptionProtector") @@ -549,9 +535,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceEncryptionProtector] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_keys_operations.py index 9173d83e7b86..b562ae8bd2f4 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_instance_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,9 +82,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceKeyListResult] = kwargs.pop("cls", None) error_map = { @@ -179,9 +173,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceKey] = kwargs.pop("cls", None) request = build_get_request( @@ -238,16 +230,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstanceKey]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceKey") @@ -416,9 +406,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceKey] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -478,9 +466,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -542,9 +528,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 c7a078d3246e..5186af09b8b9 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,10 +36,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -99,9 +95,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -160,16 +154,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstanceLongTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceLongTermRetentionPolicy") @@ -345,9 +337,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -417,9 +407,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 360d95fe669f..8a7550e5831c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_operations_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,10 +33,6 @@ build_list_by_managed_instance_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,9 +77,7 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceOperationListResult] = kwargs.pop("cls", None) error_map = { @@ -174,9 +167,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceOperation] = kwargs.pop("cls", None) request = build_get_request( @@ -243,9 +234,7 @@ async def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( 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 630366fa8dc4..162e14e6f7b8 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_managed_instance_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -93,9 +89,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = kwargs.pop("cls", None) request = build_get_request( @@ -152,16 +146,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstancePrivateEndpointConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstancePrivateEndpointConnection") @@ -327,9 +319,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -389,9 +379,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -453,9 +441,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -517,9 +503,7 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { 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 c08d97e0dc78..9f3bad521a79 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_link_resources_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -33,10 +32,6 @@ build_list_by_managed_instance_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,9 +76,7 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstancePrivateLinkListResult] = kwargs.pop("cls", None) error_map = { @@ -173,9 +166,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstancePrivateLink] = kwargs.pop("cls", None) request = build_get_request( 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 cf33015845c3..89edb61358c2 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -30,10 +30,6 @@ from ..._vendor import _convert_request from ...operations._managed_instance_tde_certificates_operations import build_create_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,16 +71,14 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "TdeCertificate") @@ -228,9 +222,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_vulnerability_assessments_operations.py index be82325491d8..65367d3bb509 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -35,10 +35,6 @@ build_list_by_instance_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,9 +93,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( @@ -251,16 +245,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceVulnerabilityAssessment") @@ -342,9 +334,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -400,9 +390,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 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 87fc3f0fcf2e..402a997f9789 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -45,10 +45,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,9 +82,7 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { @@ -167,9 +161,7 @@ def list_by_instance_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { @@ -250,9 +242,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { @@ -342,9 +332,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) request = build_get_request( @@ -400,16 +388,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstance") @@ -565,9 +551,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -626,9 +610,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -687,9 +669,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -747,16 +727,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceUpdate") @@ -909,9 +887,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -974,9 +950,7 @@ async def _failover_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( @@ -1043,9 +1017,7 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1107,9 +1079,7 @@ def list_outbound_network_dependencies_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) error_map = { @@ -1184,9 +1154,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_start_request( @@ -1245,9 +1213,7 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1303,9 +1269,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_stop_request( @@ -1364,9 +1328,7 @@ async def begin_stop( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1456,9 +1418,7 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.TopQueriesListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_ledger_digest_uploads_operations.py index 3beef9efec9f..0a27fa691817 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_ledger_digest_uploads_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_ledger_digest_uploads_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,9 +83,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedLedgerDigestUploadsListResult] = kwargs.pop("cls", None) error_map = { @@ -187,9 +181,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedLedgerDigestUploads] = kwargs.pop("cls", None) request = build_get_request( @@ -248,16 +240,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedLedgerDigestUploads]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedLedgerDigestUploads") @@ -436,9 +426,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedLedgerDigestUploads] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -504,9 +492,7 @@ async def _disable_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[Optional[_models.ManagedLedgerDigestUploads]] = kwargs.pop("cls", None) request = build_disable_request( @@ -584,9 +570,7 @@ async def begin_disable( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedLedgerDigestUploads] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py index 12d4fa67bdce..50e0ad42eca5 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -100,9 +96,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -161,16 +155,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedBackupShortTermRetentionPolicy") @@ -346,9 +338,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -415,16 +405,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedBackupShortTermRetentionPolicy") @@ -600,9 +588,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -672,9 +658,7 @@ def list_by_restorable_dropped_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 d2bca8f5b626..67f8fab6705d 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,10 +38,6 @@ build_list_by_managed_instance_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,9 +81,7 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ManagedServerDnsAliasListResult] = kwargs.pop("cls", None) error_map = { @@ -177,9 +171,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) request = build_get_request( @@ -236,16 +228,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedServerDnsAliasCreation") @@ -410,9 +400,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -472,9 +460,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -536,9 +522,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -598,16 +582,14 @@ async def _acquire_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedServerDnsAliasAcquisition") @@ -769,9 +751,7 @@ async def begin_acquire( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py index bb94cc6c38a2..dfbe1d111b98 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,10 +36,6 @@ build_list_by_instance_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,9 +92,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -155,16 +149,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedServerSecurityAlertPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedServerSecurityAlertPolicy") @@ -330,9 +322,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -399,9 +389,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 af07e7a3855d..7c1b35374fc8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,10 +28,6 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,9 +63,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 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 a3e338ec7cd0..cf658911e77c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_outbound_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_outbound_firewall_rules_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_server_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -93,9 +89,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.OutboundFirewallRule] = kwargs.pop("cls", None) request = build_get_request( @@ -152,16 +146,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.OutboundFirewallRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "OutboundFirewallRule") @@ -326,9 +318,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.OutboundFirewallRule] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -388,9 +378,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -452,9 +440,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-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) @@ -515,9 +501,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.OutboundFirewallRuleListResult] = kwargs.pop("cls", None) error_map = { 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 9287d43a0a94..3705370bf3bb 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_server_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -93,9 +89,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) request = build_get_request( @@ -152,16 +146,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "PrivateEndpointConnection") @@ -323,9 +315,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -385,9 +375,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -449,9 +437,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -513,9 +499,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { 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 b2b8536fc656..febda131aa8c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_get_request, build_list_by_server_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,9 +71,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -168,9 +161,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) request = build_get_request( 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 324a65efdc5c..8d320a0b4c5b 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from ..._vendor import _convert_request from ...operations._recommended_sensitivity_labels_operations import build_update_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -157,16 +153,14 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "RecommendedSensitivityLabelUpdateList") 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 7f735b557551..351fa8d7305a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_databases_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._recoverable_databases_operations import build_get_request, build_list_by_server_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,9 +71,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.RecoverableDatabaseListResult] = kwargs.pop("cls", None) error_map = { @@ -179,9 +172,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.RecoverableDatabase] = kwargs.pop("cls", None) request = build_get_request( 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 a5b0f6900ca6..d3e4369bbbdd 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_managed_databases_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._recoverable_managed_databases_operations import build_get_request, build_list_by_instance_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,9 +73,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.RecoverableManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { @@ -170,9 +163,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.RecoverableManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( 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 a0cefb285821..374d381348ef 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_replication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_replication_links_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,10 +38,6 @@ build_list_by_server_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,9 +82,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) error_map = { @@ -182,9 +175,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) request = build_get_request( @@ -237,9 +228,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -304,9 +293,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-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) @@ -362,9 +349,7 @@ async def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) request = build_failover_request( @@ -436,9 +421,7 @@ async def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -496,9 +479,7 @@ async def _failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) request = build_failover_allow_data_loss_request( @@ -570,9 +551,7 @@ async def begin_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -635,9 +614,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) error_map = { 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 6bea40586d12..9f29fcfcba70 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_databases_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._restorable_dropped_databases_operations import build_get_request, build_list_by_server_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,9 +73,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.RestorableDroppedDatabaseListResult] = kwargs.pop("cls", None) error_map = { @@ -181,9 +174,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.RestorableDroppedDatabase] = kwargs.pop("cls", None) request = build_get_request( 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 03be6753c8fa..0a1e53d99e27 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_managed_databases_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -33,10 +32,6 @@ build_list_by_instance_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,9 +76,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.RestorableDroppedManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { @@ -173,9 +166,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.RestorableDroppedManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( 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 5ee569e27733..8f46dfab008c 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,9 +81,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.RestorePointListResult] = kwargs.pop("cls", None) error_map = { @@ -168,16 +162,14 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.RestorePoint]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CreateDatabaseRestorePointDefinition") @@ -343,9 +335,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.RestorePoint] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -422,9 +412,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.RestorePoint] = kwargs.pop("cls", None) request = build_get_request( @@ -494,9 +482,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 8da6f181d4da..0c0817136434 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload @@ -101,9 +102,7 @@ def list_current_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { @@ -269,16 +268,14 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SensitivityLabelUpdateList") @@ -353,9 +350,7 @@ def list_recommended_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { @@ -467,9 +462,7 @@ async def enable_recommendation( # pylint: disable=inconsistent-return-statemen _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) 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") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_enable_recommendation_request( @@ -553,9 +546,7 @@ async def disable_recommendation( # pylint: disable=inconsistent-return-stateme _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) 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") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_disable_recommendation_request( @@ -639,9 +630,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) request = build_get_request( @@ -822,16 +811,14 @@ async def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SensitivityLabel") @@ -928,9 +915,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 9fa785bd37e4..88703fe63835 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,10 +36,6 @@ build_list_by_server_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,9 +80,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.LogicalServerAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { @@ -182,9 +176,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ServerAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( @@ -241,16 +233,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerAdvancedThreatProtection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerAdvancedThreatProtection") @@ -422,9 +412,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerAdvancedThreatProtection] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advisors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advisors_operations.py index 029758f95ea2..a9aebcc2b12f 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -32,10 +32,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -88,9 +84,7 @@ async def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) request = build_list_by_server_request( @@ -157,9 +151,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) request = build_get_request( @@ -299,16 +291,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Advisor") 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 67e0dd5f7abf..e4fb53f6414d 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from ..._vendor import _convert_request from ...operations._server_automatic_tuning_operations import build_get_request, build_update_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,9 +76,7 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) request = build_get_request( @@ -212,16 +206,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerAutomaticTuning") 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 72a4007fbbd3..558dadd457f0 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_server_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -98,9 +94,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerAzureADAdministrator] = kwargs.pop("cls", None) request = build_get_request( @@ -157,16 +151,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerAzureADAdministrator]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerAzureADAdministrator") @@ -335,9 +327,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerAzureADAdministrator] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -401,9 +391,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -470,9 +458,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -534,9 +520,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.AdministratorListResult] = kwargs.pop("cls", None) error_map = { 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 15d82872181d..75171e371018 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_server_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -98,9 +94,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerAzureADOnlyAuthentication] = kwargs.pop("cls", None) request = build_get_request( @@ -157,16 +151,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerAzureADOnlyAuthentication]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerAzureADOnlyAuthentication") @@ -344,9 +336,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerAzureADOnlyAuthentication] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -410,9 +400,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -479,9 +467,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -543,9 +529,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.AzureADOnlyAuthListResult] = kwargs.pop("cls", None) error_map = { 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 d1b7b82fa4b0..ccdef22e00c7 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload @@ -84,9 +85,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { @@ -176,9 +175,7 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ServerBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -235,16 +232,14 @@ async def _create_or_update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerBlobAuditingPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerBlobAuditingPolicy") @@ -408,9 +403,7 @@ async def begin_create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerBlobAuditingPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_communication_links_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_communication_links_operations.py index 2e6e69c70377..cb94d2cb128f 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_server_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -93,7 +89,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -156,7 +152,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ServerCommunicationLink] = kwargs.pop("cls", None) request = build_get_request( @@ -213,14 +209,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerCommunicationLink]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerCommunicationLink") @@ -383,7 +379,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerCommunicationLink] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -449,7 +445,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ServerCommunicationLinkListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_configuration_options_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_configuration_options_operations.py index eb99f15cdeb3..516ba4a9dfb0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_configuration_options_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_configuration_options_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,10 +36,6 @@ build_list_by_managed_instance_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,9 +80,7 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ServerConfigurationOptionListResult] = kwargs.pop("cls", None) error_map = { @@ -182,9 +176,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ServerConfigurationOption] = kwargs.pop("cls", None) request = build_get_request( @@ -241,16 +233,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerConfigurationOption] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerConfigurationOption") @@ -417,9 +407,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerConfigurationOption] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py index 6cb5eb3b4278..d96971f6824e 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,10 +36,6 @@ build_list_by_server_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,9 +92,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ServerConnectionPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -155,16 +149,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerConnectionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerConnectionPolicy") @@ -327,9 +319,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerConnectionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -395,9 +385,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ServerConnectionPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 f6acee5688fa..a4fa199bc448 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,10 +36,6 @@ build_list_by_server_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,9 +80,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ServerDevOpsAuditSettingsListResult] = kwargs.pop("cls", None) error_map = { @@ -180,9 +174,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ServerDevOpsAuditingSettings] = kwargs.pop("cls", None) request = build_get_request( @@ -239,16 +231,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) 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 _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerDevOpsAuditingSettings") @@ -411,9 +401,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerDevOpsAuditingSettings] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dns_aliases_operations.py index 619ac91be843..522200acf365 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,10 +38,6 @@ build_list_by_server_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,9 +90,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) request = build_get_request( @@ -148,9 +142,7 @@ async def _create_or_update_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[Optional[_models.ServerDnsAlias]] = kwargs.pop("cls", None) request = build_create_or_update_request( @@ -222,9 +214,7 @@ async def begin_create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) 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) @@ -281,9 +271,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -345,9 +333,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -407,9 +393,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerDnsAliasListResult] = kwargs.pop("cls", None) error_map = { @@ -489,16 +473,14 @@ async def _acquire_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerDnsAliasAcquisition") @@ -660,9 +642,7 @@ async def begin_acquire( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_keys_operations.py index 1e999d71f1ab..4290d88fed3f 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_server_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,9 +79,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerKeyListResult] = kwargs.pop("cls", None) error_map = { @@ -173,9 +167,7 @@ async def get(self, resource_group_name: str, server_name: str, key_name: str, * _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerKey] = kwargs.pop("cls", None) request = build_get_request( @@ -232,16 +224,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerKey]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerKey") @@ -416,9 +406,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerKey] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -478,9 +466,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -542,9 +528,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 56d54e46f239..3de23397293d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_operations_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,10 +28,6 @@ from ..._vendor import _convert_request from ...operations._server_operations_operations import build_list_by_server_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,9 +70,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerOperationListResult] = kwargs.pop("cls", None) error_map = { 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 109d0a624d78..e13330e36c24 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,10 +36,6 @@ build_list_by_server_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -96,9 +92,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -155,16 +149,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerSecurityAlertPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerSecurityAlertPolicy") @@ -327,9 +319,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerSecurityAlertPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -396,9 +386,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 ea8176da7a07..f782c968ad31 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_instance_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,9 +81,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ServerTrustCertificatesListResult] = kwargs.pop("cls", None) error_map = { @@ -177,9 +171,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ServerTrustCertificate] = kwargs.pop("cls", None) request = build_get_request( @@ -236,16 +228,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerTrustCertificate]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerTrustCertificate") @@ -411,9 +401,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerTrustCertificate] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -473,9 +461,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -537,9 +523,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 a2ab07b51a16..5877915d3c07 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,10 +38,6 @@ build_list_by_location_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,9 +90,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerTrustGroup] = kwargs.pop("cls", None) request = build_get_request( @@ -153,16 +147,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerTrustGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerTrustGroup") @@ -328,9 +320,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerTrustGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -390,9 +380,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -454,9 +442,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -516,9 +502,7 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -598,9 +582,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) error_map = { 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 09c00df098dd..b474633ddf76 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_usages_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,10 +28,6 @@ from ..._vendor import _convert_request from ...operations._server_usages_operations import build_list_by_server_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +70,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ServerUsageListResult] = kwargs.pop("cls", None) error_map = { 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 949aa59bd887..e1e1156071fe 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -35,10 +35,6 @@ build_list_by_server_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,9 +93,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( @@ -251,16 +245,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerVulnerabilityAssessment") @@ -342,9 +334,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -399,9 +389,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 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 7d53ebe39ea8..b55e98f23ed1 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,10 +42,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -131,16 +127,14 @@ async def check_name_availability( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckNameAvailabilityResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CheckNameAvailabilityRequest") @@ -194,9 +188,7 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { @@ -273,9 +265,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { @@ -365,9 +355,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.Server] = kwargs.pop("cls", None) request = build_get_request( @@ -419,16 +407,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Server]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Server") @@ -580,9 +566,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Server] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -641,9 +625,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -700,9 +682,7 @@ async def begin_delete(self, resource_group_name: str, server_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -756,16 +736,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Server]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerUpdate") @@ -914,9 +892,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Server] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -979,16 +955,14 @@ async def _import_database_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ImportNewDatabaseDefinition") @@ -1141,9 +1115,7 @@ async def begin_import_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ImportExportOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1202,9 +1174,7 @@ async def _refresh_status_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[Optional[_models.RefreshExternalGovernanceStatusOperationResult]] = kwargs.pop("cls", None) request = build_refresh_status_request( @@ -1271,9 +1241,7 @@ async def begin_refresh_status( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.RefreshExternalGovernanceStatusOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py index 7975c3a2284a..16d779e52963 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._service_objectives_operations import build_get_request, build_list_by_server_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +81,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ServiceObjective] = kwargs.pop("cls", None) request = build_get_request( @@ -143,7 +138,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ServiceObjectiveListResult] = kwargs.pop("cls", None) error_map = { 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 1669eacc072f..fc1fbf72d61d 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from ..._vendor import _convert_request from ...operations._sql_agent_operations import build_create_or_update_request, build_get_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,9 +78,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) request = build_get_request( @@ -213,16 +207,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SqlAgentConfiguration") 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 79579d7ba2a6..085143d859fc 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 @@ -94,9 +94,7 @@ def list_by_sql_vulnerability_assessment( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) error_map = { @@ -204,9 +202,7 @@ async def get( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) request = build_get_request( 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 d04336316471..e3200f1df96e 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload @@ -183,16 +184,14 @@ async def create_or_update( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput") 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 f39d136fe996..6176f58ffc64 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 @@ -78,9 +78,7 @@ async def _execute_initial( # pylint: disable=inconsistent-return-statements system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_execute_request( @@ -154,9 +152,7 @@ async def begin_execute( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 eb1985dd00eb..68e0c064fe13 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload @@ -98,9 +99,7 @@ def list_by_baseline( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) error_map = { @@ -212,9 +211,7 @@ async def get( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( @@ -391,16 +388,14 @@ async def create_or_update( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput") 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 a39256079f8b..48ec6362b5c2 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 @@ -101,9 +101,7 @@ async def delete( # pylint: disable=inconsistent-return-statements system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 d17dbd4668bd..d54101581bd4 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 @@ -65,7 +65,7 @@ def list_by_scan( self, resource_group_name: str, server_name: str, - vulnerability_assessment_name: Union[str, _models.SQLVulnerabilityAssessmentName], + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], scan_id: str, **kwargs: Any ) -> AsyncIterable["_models.SqlVulnerabilityAssessmentScanResults"]: @@ -79,7 +79,7 @@ def list_by_scan( :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" Required. :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SQLVulnerabilityAssessmentName + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. Required. :type scan_id: str @@ -99,9 +99,7 @@ def list_by_scan( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) error_map = { @@ -170,7 +168,7 @@ async def get( self, resource_group_name: str, server_name: str, - vulnerability_assessment_name: Union[str, _models.SQLVulnerabilityAssessmentName], + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], scan_id: str, scan_result_id: str, **kwargs: Any @@ -185,7 +183,7 @@ async def get( :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" Required. :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SQLVulnerabilityAssessmentName + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. Required. :type scan_id: str @@ -213,9 +211,7 @@ async def get( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) request = build_get_request( 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 f2a507e10a5a..4c180ae7d533 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 @@ -94,9 +94,7 @@ def list_by_sql_vulnerability_assessments( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { @@ -202,9 +200,7 @@ async def get( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( 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 742c3114b3ad..594917ecdd3b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from ..._vendor import _convert_request from ...operations._sql_vulnerability_assessments_operations import build_delete_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,9 +84,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 cdb5b63b1c08..b048f056130a 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,10 +34,6 @@ build_list_by_server_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,9 +78,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { @@ -180,9 +174,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( @@ -325,16 +317,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SqlVulnerabilityAssessment") diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_start_stop_managed_instance_schedules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_start_stop_managed_instance_schedules_operations.py index 9f0e30bc9fa5..791f7c72e994 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_start_stop_managed_instance_schedules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_start_stop_managed_instance_schedules_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -35,10 +35,6 @@ build_list_by_instance_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -83,9 +79,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.StartStopManagedInstanceScheduleListResult] = kwargs.pop("cls", None) error_map = { @@ -180,9 +174,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.StartStopManagedInstanceSchedule] = kwargs.pop("cls", None) request = build_get_request( @@ -325,16 +317,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.StartStopManagedInstanceSchedule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "StartStopManagedInstanceSchedule") @@ -415,9 +405,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 ea5e69554ab4..a79c15a5250e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_subscription_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_subscription_usages_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._subscription_usages_operations import build_get_request, build_list_by_location_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,9 +66,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SubscriptionUsageListResult] = kwargs.pop("cls", None) error_map = { @@ -157,9 +150,7 @@ async def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SubscriptionUsage] = kwargs.pop("cls", None) request = build_get_request( 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 328df999a34e..4c3d1e928d8d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_synapse_link_workspaces_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_synapse_link_workspaces_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,10 +28,6 @@ from ..._vendor import _convert_request from ...operations._synapse_link_workspaces_operations import build_list_by_database_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,9 +73,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.SynapseLinkWorkspaceListResult] = kwargs.pop("cls", None) error_map = { 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 8bb01d52dd5d..e19cb88cefc8 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,10 +39,6 @@ build_list_linked_databases_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,9 +91,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncAgent] = kwargs.pop("cls", None) request = build_get_request( @@ -154,16 +148,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.SyncAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SyncAgent") @@ -329,9 +321,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncAgent] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -391,9 +381,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -455,9 +443,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -517,9 +503,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncAgentListResult] = kwargs.pop("cls", None) error_map = { @@ -609,9 +593,7 @@ async def generate_key( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncAgentKeyProperties] = kwargs.pop("cls", None) request = build_generate_key_request( @@ -671,9 +653,7 @@ def list_linked_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncAgentLinkedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 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 b0dc5a701da4..da7f60971dae 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -44,10 +44,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,9 +85,7 @@ def list_sync_database_ids( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncDatabaseIdListResult] = kwargs.pop("cls", None) error_map = { @@ -165,9 +159,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_refresh_hub_schema_request( @@ -232,9 +224,7 @@ async def begin_refresh_hub_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -301,9 +291,7 @@ def list_hub_schemas( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) error_map = { @@ -409,9 +397,7 @@ def list_logs( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncGroupLogListResult] = kwargs.pop("cls", None) error_map = { @@ -509,9 +495,7 @@ async def cancel_sync( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_sync_request( @@ -577,9 +561,7 @@ async def trigger_sync( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_trigger_sync_request( @@ -645,9 +627,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) request = build_get_request( @@ -706,16 +686,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.SyncGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SyncGroup") @@ -891,9 +869,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -954,9 +930,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -1021,9 +995,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1085,16 +1057,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.SyncGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SyncGroup") @@ -1267,9 +1237,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1337,9 +1305,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncGroupListResult] = kwargs.pop("cls", None) error_map = { 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 7c71977c112e..461e48e40fe8 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,10 +40,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -107,9 +103,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) request = build_get_request( @@ -170,16 +164,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.SyncMember]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SyncMember") @@ -368,9 +360,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -438,9 +428,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -515,9 +503,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -581,16 +567,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.SyncMember]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SyncMember") @@ -776,9 +760,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -849,9 +831,7 @@ def list_by_sync_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncMemberListResult] = kwargs.pop("cls", None) error_map = { @@ -948,9 +928,7 @@ def list_member_schemas( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) error_map = { @@ -1034,9 +1012,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_refresh_member_schema_request( @@ -1111,9 +1087,7 @@ async def begin_refresh_member_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 b137e9469083..6eb199ba6652 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -30,10 +30,6 @@ from ..._vendor import _convert_request from ...operations._tde_certificates_operations import build_create_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,16 +67,14 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "TdeCertificate") @@ -220,9 +214,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_time_zones_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_time_zones_operations.py index 66628f639b22..a354de855cfa 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_time_zones_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_time_zones_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ..._vendor import _convert_request from ...operations._time_zones_operations import build_get_request, build_list_by_location_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,9 +66,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.TimeZoneListResult] = kwargs.pop("cls", None) error_map = { @@ -157,9 +150,7 @@ async def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.TimeZone] = kwargs.pop("cls", None) request = build_get_request( 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 d320b7348fa9..9bfb2cde9706 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,10 +36,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,9 +83,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.LogicalDatabaseTransparentDataEncryptionListResult] = kwargs.pop("cls", None) error_map = { @@ -188,9 +182,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = kwargs.pop("cls", None) request = build_get_request( @@ -249,16 +241,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.LogicalDatabaseTransparentDataEncryption]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "LogicalDatabaseTransparentDataEncryption") @@ -440,9 +430,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_usages_operations.py index 0820c3dc98fb..cbe42d0ae7db 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_usages_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -29,10 +28,6 @@ from ..._vendor import _convert_request from ...operations._usages_operations import build_list_by_instance_pool_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,9 +73,7 @@ def list_by_instance_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None) error_map = { 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 44f2fac1937e..e567f3b5b1d8 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,10 +39,6 @@ build_update_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,9 +74,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.VirtualCluster"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) error_map = { @@ -154,9 +148,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) error_map = { @@ -241,9 +233,7 @@ async def get(self, resource_group_name: str, virtual_cluster_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.VirtualCluster] = kwargs.pop("cls", None) request = build_get_request( @@ -294,9 +284,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -355,9 +343,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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) @@ -415,16 +401,14 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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.VirtualCluster]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "VirtualClusterUpdate") @@ -577,9 +561,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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.VirtualCluster] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -638,9 +620,7 @@ async def _update_dns_servers_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[Optional[_models.UpdateVirtualClusterDnsServersOperation]] = kwargs.pop("cls", None) request = build_update_dns_servers_request( @@ -708,9 +688,7 @@ async def begin_update_dns_servers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.UpdateVirtualClusterDnsServersOperation] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_network_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_network_rules_operations.py index f033e2128f0d..5f1bec7657b5 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_server_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -93,9 +89,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VirtualNetworkRule] = kwargs.pop("cls", None) request = build_get_request( @@ -152,16 +146,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.VirtualNetworkRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "VirtualNetworkRule") @@ -327,9 +319,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.VirtualNetworkRule] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -389,9 +379,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -453,9 +441,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -515,9 +501,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VirtualNetworkRuleListResult] = kwargs.pop("cls", None) error_map = { 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 5755e1ed946c..1d92106e2b4b 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_workload_group_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -104,9 +100,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.WorkloadClassifier] = kwargs.pop("cls", None) request = build_get_request( @@ -167,16 +161,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WorkloadClassifier]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "WorkloadClassifier") @@ -368,9 +360,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadClassifier] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -438,9 +428,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -515,9 +503,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -584,9 +570,7 @@ def list_by_workload_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.WorkloadClassifierListResult] = kwargs.pop("cls", None) error_map = { 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 6cd9e80dfcab..5edb044cbd1d 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ build_list_by_database_request, ) -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -95,9 +91,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.WorkloadGroup] = kwargs.pop("cls", None) request = build_get_request( @@ -156,16 +150,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WorkloadGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "WorkloadGroup") @@ -341,9 +333,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -404,9 +394,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -471,9 +459,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -536,9 +522,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.WorkloadGroupListResult] = kwargs.pop("cls", None) error_map = { 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 2a17373ff534..00d32023a5d2 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 @@ -521,7 +521,6 @@ from ._sql_management_client_enums import RuleSeverity from ._sql_management_client_enums import RuleStatus from ._sql_management_client_enums import RuleType -from ._sql_management_client_enums import SQLVulnerabilityAssessmentName from ._sql_management_client_enums import SampleName from ._sql_management_client_enums import SecondaryInstanceType from ._sql_management_client_enums import SecondaryType @@ -1086,7 +1085,6 @@ "RuleSeverity", "RuleStatus", "RuleType", - "SQLVulnerabilityAssessmentName", "SampleName", "SecondaryInstanceType", "SecondaryType", 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 dfa1555a2f36..1937f5a19c7c 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 @@ -4000,7 +4000,7 @@ class DistributedAvailabilityGroup(ProxyResource): # pylint: disable=too-many-i :ivar secondary_availability_group_name: The secondary availability group name. :vartype secondary_availability_group_name: str :ivar replication_mode: The replication mode of a distributed availability group. Parameter - will be ignored during link creation. Known values are: "Async" and "Sync". + will be ignored during link creation. Known values are: "Async", "Sync", and "Async". :vartype replication_mode: str or ~azure.mgmt.sql.models.ReplicationMode :ivar distributed_availability_group_id: The distributed availability group id. :vartype distributed_availability_group_id: str @@ -4061,7 +4061,7 @@ def __init__( :keyword secondary_availability_group_name: The secondary availability group name. :paramtype secondary_availability_group_name: str :keyword replication_mode: The replication mode of a distributed availability group. Parameter - will be ignored during link creation. Known values are: "Async" and "Sync". + will be ignored during link creation. Known values are: "Async", "Sync", and "Async". :paramtype replication_mode: str or ~azure.mgmt.sql.models.ReplicationMode """ super().__init__(**kwargs) @@ -7526,7 +7526,7 @@ class IPv6FirewallRule(ProxyResourceWithWritableName): :ivar start_i_pv6_address: The start IP address of the firewall rule. Must be IPv6 format. :vartype start_i_pv6_address: str :ivar end_i_pv6_address: The end IP address of the firewall rule. Must be IPv6 format. Must be - greater than or equal to startIpAddress. + greater than or equal to startIpv6Address. :vartype end_i_pv6_address: str """ @@ -7557,7 +7557,7 @@ def __init__( :keyword start_i_pv6_address: The start IP address of the firewall rule. Must be IPv6 format. :paramtype start_i_pv6_address: str :keyword end_i_pv6_address: The end IP address of the firewall rule. Must be IPv6 format. Must - be greater than or equal to startIpAddress. + be greater than or equal to startIpv6Address. :paramtype end_i_pv6_address: str """ super().__init__(name=name, **kwargs) @@ -19488,6 +19488,8 @@ class SqlVulnerabilityAssessmentScanRecord(ProxyResource): # pylint: disable=to :vartype total_rules_count: int :ivar is_baseline_applied: Baseline created for this database, and has one or more rules. :vartype is_baseline_applied: bool + :ivar last_scan_time: The last scan time. + :vartype last_scan_time: ~datetime.datetime """ _validation = { @@ -19511,6 +19513,7 @@ class SqlVulnerabilityAssessmentScanRecord(ProxyResource): # pylint: disable=to "total_failed_rules_count": {"readonly": True}, "total_rules_count": {"readonly": True}, "is_baseline_applied": {"readonly": True}, + "last_scan_time": {"readonly": True}, } _attribute_map = { @@ -19534,6 +19537,7 @@ class SqlVulnerabilityAssessmentScanRecord(ProxyResource): # pylint: disable=to "total_failed_rules_count": {"key": "properties.totalFailedRulesCount", "type": "int"}, "total_rules_count": {"key": "properties.totalRulesCount", "type": "int"}, "is_baseline_applied": {"key": "properties.isBaselineApplied", "type": "bool"}, + "last_scan_time": {"key": "properties.lastScanTime", "type": "iso-8601"}, } def __init__(self, **kwargs: Any) -> None: @@ -19556,6 +19560,7 @@ def __init__(self, **kwargs: Any) -> None: self.total_failed_rules_count = None self.total_rules_count = None self.is_baseline_applied = None + self.last_scan_time = None class SqlVulnerabilityAssessmentScanRecordListResult(_serialization.Model): 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 2670cd53f424..b4f95f0914a1 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 @@ -972,6 +972,7 @@ class ReplicationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): ASYNC = "Async" SYNC = "Sync" + ASYNC_ENUM = "Async" class ReplicationRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1268,12 +1269,6 @@ class SqlAgentConfigurationPropertiesState(str, Enum, metaclass=CaseInsensitiveE DISABLED = "Disabled" -class SQLVulnerabilityAssessmentName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SQLVulnerabilityAssessmentName.""" - - DEFAULT = "default" - - class SqlVulnerabilityAssessmentName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SqlVulnerabilityAssessmentName.""" 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 d6642f431e59..b4dafd81fe63 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 @@ -32,7 +32,6 @@ from ._deleted_servers_operations import DeletedServersOperations from ._elastic_pool_operations_operations import ElasticPoolOperationsOperations from ._encryption_protectors_operations import EncryptionProtectorsOperations -from ._failover_groups_operations import FailoverGroupsOperations from ._firewall_rules_operations import FirewallRulesOperations from ._instance_pools_operations import InstancePoolsOperations from ._job_agents_operations import JobAgentsOperations @@ -122,7 +121,6 @@ from ._server_connection_policies_operations import ServerConnectionPoliciesOperations from ._distributed_availability_groups_operations import DistributedAvailabilityGroupsOperations from ._server_trust_certificates_operations import ServerTrustCertificatesOperations -from ._ipv6_firewall_rules_operations import IPv6FirewallRulesOperations from ._endpoint_certificates_operations import EndpointCertificatesOperations from ._managed_database_sensitivity_labels_operations import ManagedDatabaseSensitivityLabelsOperations from ._managed_database_recommended_sensitivity_labels_operations import ( @@ -137,22 +135,6 @@ from ._database_advanced_threat_protection_settings_operations import DatabaseAdvancedThreatProtectionSettingsOperations from ._server_advanced_threat_protection_settings_operations import ServerAdvancedThreatProtectionSettingsOperations from ._managed_server_dns_aliases_operations import ManagedServerDnsAliasesOperations -from ._database_sql_vulnerability_assessment_baselines_operations import ( - DatabaseSqlVulnerabilityAssessmentBaselinesOperations, -) -from ._database_sql_vulnerability_assessment_execute_scan_operations import ( - DatabaseSqlVulnerabilityAssessmentExecuteScanOperations, -) -from ._database_sql_vulnerability_assessment_rule_baselines_operations import ( - DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations, -) -from ._database_sql_vulnerability_assessment_scan_result_operations import ( - DatabaseSqlVulnerabilityAssessmentScanResultOperations, -) -from ._database_sql_vulnerability_assessment_scans_operations import DatabaseSqlVulnerabilityAssessmentScansOperations -from ._database_sql_vulnerability_assessments_settings_operations import ( - DatabaseSqlVulnerabilityAssessmentsSettingsOperations, -) from ._managed_database_advanced_threat_protection_settings_operations import ( ManagedDatabaseAdvancedThreatProtectionSettingsOperations, ) @@ -160,15 +142,6 @@ ManagedInstanceAdvancedThreatProtectionSettingsOperations, ) from ._replication_links_operations import ReplicationLinksOperations -from ._sql_vulnerability_assessment_baseline_operations import SqlVulnerabilityAssessmentBaselineOperations -from ._sql_vulnerability_assessment_baselines_operations import SqlVulnerabilityAssessmentBaselinesOperations -from ._sql_vulnerability_assessment_execute_scan_operations import SqlVulnerabilityAssessmentExecuteScanOperations -from ._sql_vulnerability_assessment_rule_baseline_operations import SqlVulnerabilityAssessmentRuleBaselineOperations -from ._sql_vulnerability_assessment_rule_baselines_operations import SqlVulnerabilityAssessmentRuleBaselinesOperations -from ._sql_vulnerability_assessment_scan_result_operations import SqlVulnerabilityAssessmentScanResultOperations -from ._sql_vulnerability_assessment_scans_operations import SqlVulnerabilityAssessmentScansOperations -from ._sql_vulnerability_assessments_settings_operations import SqlVulnerabilityAssessmentsSettingsOperations -from ._sql_vulnerability_assessments_operations import SqlVulnerabilityAssessmentsOperations from ._managed_database_move_operations_operations import ManagedDatabaseMoveOperationsOperations from ._managed_instance_dtcs_operations import ManagedInstanceDtcsOperations from ._synapse_link_workspaces_operations import SynapseLinkWorkspacesOperations @@ -185,6 +158,33 @@ from ._servers_operations import ServersOperations from ._start_stop_managed_instance_schedules_operations import StartStopManagedInstanceSchedulesOperations from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations +from ._failover_groups_operations import FailoverGroupsOperations +from ._ipv6_firewall_rules_operations import IPv6FirewallRulesOperations +from ._sql_vulnerability_assessment_baseline_operations import SqlVulnerabilityAssessmentBaselineOperations +from ._sql_vulnerability_assessment_baselines_operations import SqlVulnerabilityAssessmentBaselinesOperations +from ._sql_vulnerability_assessment_execute_scan_operations import SqlVulnerabilityAssessmentExecuteScanOperations +from ._sql_vulnerability_assessment_rule_baseline_operations import SqlVulnerabilityAssessmentRuleBaselineOperations +from ._sql_vulnerability_assessment_rule_baselines_operations import SqlVulnerabilityAssessmentRuleBaselinesOperations +from ._sql_vulnerability_assessment_scan_result_operations import SqlVulnerabilityAssessmentScanResultOperations +from ._sql_vulnerability_assessment_scans_operations import SqlVulnerabilityAssessmentScansOperations +from ._sql_vulnerability_assessments_settings_operations import SqlVulnerabilityAssessmentsSettingsOperations +from ._sql_vulnerability_assessments_operations import SqlVulnerabilityAssessmentsOperations +from ._database_sql_vulnerability_assessment_baselines_operations import ( + DatabaseSqlVulnerabilityAssessmentBaselinesOperations, +) +from ._database_sql_vulnerability_assessment_execute_scan_operations import ( + DatabaseSqlVulnerabilityAssessmentExecuteScanOperations, +) +from ._database_sql_vulnerability_assessment_rule_baselines_operations import ( + DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations, +) +from ._database_sql_vulnerability_assessment_scan_result_operations import ( + DatabaseSqlVulnerabilityAssessmentScanResultOperations, +) +from ._database_sql_vulnerability_assessment_scans_operations import DatabaseSqlVulnerabilityAssessmentScansOperations +from ._database_sql_vulnerability_assessments_settings_operations import ( + DatabaseSqlVulnerabilityAssessmentsSettingsOperations, +) from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -215,7 +215,6 @@ "DeletedServersOperations", "ElasticPoolOperationsOperations", "EncryptionProtectorsOperations", - "FailoverGroupsOperations", "FirewallRulesOperations", "InstancePoolsOperations", "JobAgentsOperations", @@ -293,7 +292,6 @@ "ServerConnectionPoliciesOperations", "DistributedAvailabilityGroupsOperations", "ServerTrustCertificatesOperations", - "IPv6FirewallRulesOperations", "EndpointCertificatesOperations", "ManagedDatabaseSensitivityLabelsOperations", "ManagedDatabaseRecommendedSensitivityLabelsOperations", @@ -306,24 +304,9 @@ "DatabaseAdvancedThreatProtectionSettingsOperations", "ServerAdvancedThreatProtectionSettingsOperations", "ManagedServerDnsAliasesOperations", - "DatabaseSqlVulnerabilityAssessmentBaselinesOperations", - "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations", - "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations", - "DatabaseSqlVulnerabilityAssessmentScanResultOperations", - "DatabaseSqlVulnerabilityAssessmentScansOperations", - "DatabaseSqlVulnerabilityAssessmentsSettingsOperations", "ManagedDatabaseAdvancedThreatProtectionSettingsOperations", "ManagedInstanceAdvancedThreatProtectionSettingsOperations", "ReplicationLinksOperations", - "SqlVulnerabilityAssessmentBaselineOperations", - "SqlVulnerabilityAssessmentBaselinesOperations", - "SqlVulnerabilityAssessmentExecuteScanOperations", - "SqlVulnerabilityAssessmentRuleBaselineOperations", - "SqlVulnerabilityAssessmentRuleBaselinesOperations", - "SqlVulnerabilityAssessmentScanResultOperations", - "SqlVulnerabilityAssessmentScansOperations", - "SqlVulnerabilityAssessmentsSettingsOperations", - "SqlVulnerabilityAssessmentsOperations", "ManagedDatabaseMoveOperationsOperations", "ManagedInstanceDtcsOperations", "SynapseLinkWorkspacesOperations", @@ -340,6 +323,23 @@ "ServersOperations", "StartStopManagedInstanceSchedulesOperations", "TransparentDataEncryptionsOperations", + "FailoverGroupsOperations", + "IPv6FirewallRulesOperations", + "SqlVulnerabilityAssessmentBaselineOperations", + "SqlVulnerabilityAssessmentBaselinesOperations", + "SqlVulnerabilityAssessmentExecuteScanOperations", + "SqlVulnerabilityAssessmentRuleBaselineOperations", + "SqlVulnerabilityAssessmentRuleBaselinesOperations", + "SqlVulnerabilityAssessmentScanResultOperations", + "SqlVulnerabilityAssessmentScansOperations", + "SqlVulnerabilityAssessmentsSettingsOperations", + "SqlVulnerabilityAssessmentsOperations", + "DatabaseSqlVulnerabilityAssessmentBaselinesOperations", + "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations", + "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations", + "DatabaseSqlVulnerabilityAssessmentScanResultOperations", + "DatabaseSqlVulnerabilityAssessmentScansOperations", + "DatabaseSqlVulnerabilityAssessmentsSettingsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py index bbaaeca45e9b..e3ec1f056aa9 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,9 +49,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,9 +87,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -136,9 +128,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -174,9 +164,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: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,9 +245,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -318,16 +304,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "BackupShortTermRetentionPolicy") @@ -500,9 +484,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -569,16 +551,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.BackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "BackupShortTermRetentionPolicy") @@ -751,9 +731,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -822,9 +800,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.BackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 10a3161dfdf2..b7d5609f24c5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_capabilities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_capabilities_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,9 +44,7 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -124,9 +117,7 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.LocationCapabilities] = kwargs.pop("cls", None) request = build_list_by_location_request( 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 067d0c400311..73b7d4cb67e2 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload @@ -45,7 +46,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -82,7 +83,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") accept = _headers.pop("Accept", "application/json") @@ -243,7 +244,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) @@ -251,7 +252,7 @@ def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DataMaskingPolicy") @@ -328,7 +329,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) 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 09ddc2f4ecfc..a612b1b2ab3f 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload @@ -51,7 +52,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -89,7 +90,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: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") accept = _headers.pop("Accept", "application/json") @@ -261,7 +262,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DataMaskingRule] = kwargs.pop("cls", None) @@ -269,7 +270,7 @@ def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DataMaskingRule") @@ -343,7 +344,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") cls: ClsType[_models.DataMaskingRuleListResult] = kwargs.pop("cls", None) 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 2ef4e60d5a9e..0471447cb2df 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,9 +46,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,9 +81,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,9 +164,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DataWarehouseUserActivities] = kwargs.pop("cls", None) request = build_get_request( @@ -236,9 +225,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DataWarehouseUserActivitiesListResult] = kwargs.pop("cls", None) error_map = { 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 85bce065479d..2ad0b25fcb51 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +42,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: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,9 +79,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,9 +119,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -202,9 +192,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { @@ -304,9 +292,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( @@ -462,16 +448,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseAdvancedThreatProtection") 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 35b5b3105e75..379358efef05 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,9 +47,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,9 +86,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,9 +124,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -219,9 +209,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) request = build_list_by_database_request( @@ -291,9 +279,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) request = build_get_request( @@ -443,16 +429,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Advisor") 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 5fe9d7ce6481..629100912dd8 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,9 +41,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,9 +73,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -158,9 +150,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) request = build_get_request( @@ -300,16 +290,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseAutomaticTuning") 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 6274e95de4af..e572270997fc 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload @@ -46,9 +47,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: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,9 +80,7 @@ def build_get_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -117,9 +114,7 @@ def build_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -190,9 +185,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { @@ -287,9 +280,7 @@ def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -440,16 +431,14 @@ def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseBlobAuditingPolicy") 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 913a0116ca55..15d2729ce851 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_columns_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_columns_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -56,9 +51,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,9 +101,7 @@ def build_list_by_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,9 +144,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -244,9 +233,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { @@ -348,9 +335,7 @@ def list_by_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { @@ -457,9 +442,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) request = build_get_request( diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_encryption_protectors_operations.py index 588c21519057..ad7a5e27e9b3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_encryption_protectors_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,9 +46,7 @@ def build_revalidate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -85,9 +78,7 @@ def build_revert_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -147,9 +138,7 @@ def _revalidate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_revalidate_request( @@ -220,9 +209,7 @@ def begin_revalidate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -285,9 +272,7 @@ def _revert_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_revert_request( @@ -358,9 +343,7 @@ def begin_revert( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 fc8fe06f4845..19f1bb4fad09 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +48,7 @@ def build_get_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -87,9 +81,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -125,9 +117,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: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -203,9 +193,7 @@ def get( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_get_request( @@ -260,16 +248,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ImportExportExtensionsOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseExtensions") @@ -445,9 +431,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ImportExportExtensionsOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -517,9 +501,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.ImportExportExtensionsOperationListResult] = kwargs.pop("cls", None) error_map = { 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 23d71c240578..72a62cbe843a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_operations_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,9 +45,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -80,9 +73,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: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -158,9 +149,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( @@ -216,9 +205,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.DatabaseOperationListResult] = kwargs.pop("cls", None) error_map = { 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 878f7141f3b6..3f90b787e61b 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,9 +46,7 @@ def build_list_by_database_advisor_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,9 +85,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,9 +125,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -216,9 +206,7 @@ def list_by_database_advisor( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[List[_models.RecommendedAction]] = kwargs.pop("cls", None) request = build_list_by_database_advisor_request( @@ -296,9 +284,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) request = build_get_request( @@ -458,16 +444,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "RecommendedAction") 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 7086f82e1d0f..7382c020b1b2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_schemas_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_schemas_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +47,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,9 +86,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,9 +161,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) error_map = { @@ -266,9 +255,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) request = build_get_request( 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 882d79d78e3b..02fb304eac19 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,9 +47,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,9 +85,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -129,9 +121,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,9 +203,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -368,16 +356,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseSecurityAlertPolicy") @@ -448,9 +434,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSecurityAlertListResult] = kwargs.pop("cls", None) error_map = { 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 cb4a0cd8e571..cef9dbc86a8a 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,9 +47,7 @@ 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: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,9 +88,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -138,9 +130,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -223,9 +213,7 @@ def list_by_sql_vulnerability_assessment( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) error_map = { @@ -330,9 +318,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) request = build_get_request( @@ -497,16 +483,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput") 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 b162e401c504..ae479e6d77e6 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,9 +46,7 @@ def build_execute_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -115,9 +108,7 @@ def _execute_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_execute_request( @@ -188,9 +179,7 @@ def begin_execute( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 29cde94baa97..2d3328030f52 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +48,7 @@ def build_list_by_baseline_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,9 +91,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,9 +135,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -191,9 +181,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -272,9 +260,7 @@ def list_by_baseline( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) error_map = { @@ -383,9 +369,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( @@ -559,16 +543,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput") @@ -657,9 +639,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 77c01f747f15..091525a952c5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scan_result_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scan_result_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +39,7 @@ def build_list_by_scan_request( resource_group_name: str, server_name: str, database_name: str, - vulnerability_assessment_name: Union[str, _models.SQLVulnerabilityAssessmentName], + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], scan_id: str, subscription_id: str, **kwargs: Any @@ -52,9 +47,7 @@ def build_list_by_scan_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +81,7 @@ def build_get_request( resource_group_name: str, server_name: str, database_name: str, - vulnerability_assessment_name: Union[str, _models.SQLVulnerabilityAssessmentName], + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], scan_id: str, scan_result_id: str, subscription_id: str, @@ -97,9 +90,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,7 +146,7 @@ def list_by_scan( resource_group_name: str, server_name: str, database_name: str, - vulnerability_assessment_name: Union[str, _models.SQLVulnerabilityAssessmentName], + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], scan_id: str, **kwargs: Any ) -> Iterable["_models.SqlVulnerabilityAssessmentScanResults"]: @@ -171,7 +162,7 @@ def list_by_scan( :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" Required. :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SQLVulnerabilityAssessmentName + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. Required. :type scan_id: str @@ -185,9 +176,7 @@ def list_by_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) error_map = { @@ -257,7 +246,7 @@ def get( resource_group_name: str, server_name: str, database_name: str, - vulnerability_assessment_name: Union[str, _models.SQLVulnerabilityAssessmentName], + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], scan_id: str, scan_result_id: str, **kwargs: Any @@ -274,7 +263,7 @@ def get( :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" Required. :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SQLVulnerabilityAssessmentName + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. Required. :type scan_id: str @@ -296,9 +285,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) request = build_get_request( 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 6ad92eb0c1ff..5e4362e0e13e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scans_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,9 +46,7 @@ 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: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,9 +87,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -176,9 +167,7 @@ def list_by_sql_vulnerability_assessments( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { @@ -281,9 +270,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( 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 1c9482756a9d..eb51dcad7488 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessments_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessments_settings_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +41,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: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,9 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -157,9 +148,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { @@ -259,9 +248,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( 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 03585170b9db..cced9b103023 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,9 +48,7 @@ def build_list_by_schema_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,9 +89,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,9 +168,7 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) error_map = { @@ -282,9 +271,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) request = build_get_request( 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 cb00e4530b71..6a9f88f59b06 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_usages_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +41,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: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,9 +107,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.DatabaseUsageListResult] = kwargs.pop("cls", None) error_map = { 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 b185ac23e036..f8ad939b7ddd 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +48,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,9 +92,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -146,9 +138,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -239,9 +229,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( @@ -423,16 +411,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseVulnerabilityAssessmentRuleBaseline") @@ -524,9 +510,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 97e95674dc22..f568e4d52a82 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_scans_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -31,10 +30,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,9 +48,7 @@ def build_initiate_scan_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -91,9 +84,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,9 +125,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,9 +167,7 @@ def build_export_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -249,9 +236,7 @@ def _initiate_scan_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_initiate_scan_request( @@ -326,9 +311,7 @@ def begin_initiate_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -401,9 +384,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { @@ -506,9 +487,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( @@ -588,9 +567,7 @@ def export( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) request = build_export_request( 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 f31bdcd6d240..07b8fe6f23a6 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,9 +47,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,9 +87,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -137,9 +129,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -169,9 +159,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -254,9 +242,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( @@ -412,16 +398,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseVulnerabilityAssessment") @@ -507,9 +491,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -567,9 +549,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 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 36c2a626a665..9351043880cc 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +44,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +77,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: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,9 +109,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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,9 +149,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,9 +185,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -229,9 +219,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -258,9 +246,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -295,9 +281,7 @@ def build_export_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -337,9 +321,7 @@ def build_failover_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -368,9 +350,7 @@ def build_import_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -405,9 +385,7 @@ def build_rename_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -439,9 +417,7 @@ def build_pause_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -473,9 +449,7 @@ def build_resume_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -506,9 +480,7 @@ def build_upgrade_data_warehouse_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -535,9 +507,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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -569,9 +539,7 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -639,7 +607,7 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { @@ -723,7 +691,7 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -806,9 +774,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { @@ -910,9 +876,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.Database] = kwargs.pop("cls", None) request = build_get_request( @@ -971,16 +935,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Database") @@ -1143,9 +1105,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Database] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1207,9 +1167,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -1271,9 +1229,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1335,16 +1291,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseUpdate") @@ -1504,9 +1458,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Database] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1573,16 +1525,14 @@ def _export_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ExportDatabaseDefinition") @@ -1745,9 +1695,7 @@ def begin_export( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ImportExportOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1812,9 +1760,7 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( @@ -1885,9 +1831,7 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1948,16 +1892,14 @@ def _import_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ImportExistingDatabaseDefinition") @@ -2120,9 +2062,7 @@ def begin_import_method( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ImportExportOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2270,16 +2210,14 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ResourceMoveDefinition") @@ -2332,9 +2270,7 @@ def _pause_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) request = build_pause_request( @@ -2402,9 +2338,7 @@ def begin_pause( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-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) @@ -2461,9 +2395,7 @@ def _resume_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[Optional[_models.Database]] = kwargs.pop("cls", None) request = build_resume_request( @@ -2531,9 +2463,7 @@ def begin_resume( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-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) @@ -2590,9 +2520,7 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_upgrade_data_warehouse_request( @@ -2654,9 +2582,7 @@ def begin_upgrade_data_warehouse( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2718,9 +2644,7 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { @@ -2801,9 +2725,7 @@ def list_inaccessible_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map = { 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 d57e930d960e..cf9fc275e616 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -31,10 +30,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +41,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,9 +65,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,9 +94,7 @@ def build_list_by_location_request(location_name: str, subscription_id: str, **k _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,9 +124,7 @@ def build_recover_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,9 +180,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.DeletedServer"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) error_map = { @@ -276,9 +261,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DeletedServer] = kwargs.pop("cls", None) request = build_get_request( @@ -329,9 +312,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) error_map = { @@ -405,9 +386,7 @@ def _recover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[Optional[_models.DeletedServer]] = kwargs.pop("cls", None) request = build_recover_request( @@ -472,9 +451,7 @@ def begin_recover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DeletedServer] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_distributed_availability_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_distributed_availability_groups_operations.py index b15455a9456f..665510879dd7 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,9 +79,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,9 +117,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -167,9 +157,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -202,9 +190,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -274,9 +260,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DistributedAvailabilityGroupsListResult] = kwargs.pop("cls", None) error_map = { @@ -370,9 +354,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) request = build_get_request( @@ -429,16 +411,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DistributedAvailabilityGroup") @@ -604,9 +584,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -670,9 +648,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -738,9 +714,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -800,16 +774,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DistributedAvailabilityGroup") @@ -972,9 +944,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 d1eb0607654f..fa0dbc7bd43f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +41,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: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +108,7 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ElasticPoolActivityListResult] = kwargs.pop("cls", None) error_map = { 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 d47ea2e89568..d1487c195c7c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +41,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: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +108,7 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ElasticPoolDatabaseActivityListResult] = kwargs.pop("cls", None) error_map = { 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 de5e3125c3d7..23d786cf5e3c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,9 +45,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -80,9 +73,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -158,9 +149,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( @@ -217,9 +206,7 @@ def list_by_elastic_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ElasticPoolOperationListResult] = kwargs.pop("cls", None) error_map = { 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 89aae80baa1a..6c3f4f7a70e4 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -54,7 +50,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +83,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: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -119,9 +115,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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,9 +148,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,9 +180,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -224,9 +214,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -253,9 +241,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -289,9 +275,7 @@ def build_failover_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -355,7 +339,7 @@ def list_metrics( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) error_map = { @@ -439,7 +423,7 @@ def list_metric_definitions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) error_map = { @@ -522,9 +506,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ElasticPoolListResult] = kwargs.pop("cls", None) error_map = { @@ -615,9 +597,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) request = build_get_request( @@ -674,16 +654,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ElasticPool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ElasticPool") @@ -849,9 +827,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -913,9 +889,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -977,9 +951,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1041,16 +1013,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ElasticPool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ElasticPoolUpdate") @@ -1213,9 +1183,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1277,9 +1245,7 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( @@ -1341,9 +1307,7 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 014406cd5aad..6d7142f27a55 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,9 +79,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,9 +115,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -163,9 +153,7 @@ def build_revalidate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -224,9 +212,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.EncryptionProtectorListResult] = kwargs.pop("cls", None) error_map = { @@ -321,9 +307,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.EncryptionProtector] = kwargs.pop("cls", None) request = build_get_request( @@ -380,16 +364,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.EncryptionProtector]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "EncryptionProtector") @@ -555,9 +537,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.EncryptionProtector] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -621,9 +601,7 @@ def _revalidate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_revalidate_request( @@ -690,9 +668,7 @@ def begin_revalidate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 d8a45325108e..6a3c8d8ce351 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_endpoint_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_endpoint_certificates_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +41,7 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,9 +72,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,9 +136,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.EndpointCertificateListResult] = kwargs.pop("cls", None) error_map = { @@ -238,9 +227,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.EndpointCertificate] = kwargs.pop("cls", None) request = build_get_request( 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 5ff129b7a268..07d6a8d0db6f 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload @@ -46,9 +47,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: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,9 +80,7 @@ def build_get_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -117,9 +114,7 @@ def build_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -190,9 +185,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { @@ -287,9 +280,7 @@ def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -440,16 +431,14 @@ def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ExtendedDatabaseBlobAuditingPolicy") 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 b7d58b653c07..66f3c852896f 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload @@ -48,9 +49,7 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,9 +79,7 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,9 +112,7 @@ def build_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -185,9 +180,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ExtendedServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { @@ -279,9 +272,7 @@ def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -338,16 +329,14 @@ def _create_or_update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ExtendedServerBlobAuditingPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ExtendedServerBlobAuditingPolicy") @@ -511,9 +500,7 @@ def begin_create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_failover_groups_operations.py index 9ceca6e74fdd..9645f66dbc63 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,15 +38,44 @@ _SERIALIZER.client_side_validation = False +def build_list_by_server_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups", + ) # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + def build_get_request( resource_group_name: str, server_name: str, failover_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,9 +107,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -118,9 +141,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -147,9 +168,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -178,25 +197,24 @@ def build_update_request( return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +def build_failover_request( + resource_group_name: str, server_name: str, failover_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover", ) # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_group_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -208,24 +226,22 @@ def build_list_by_server_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_failover_request( +def build_force_failover_allow_data_loss_request( resource_group_name: str, server_name: str, failover_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss", ) # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -245,21 +261,19 @@ def build_failover_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_force_failover_allow_data_loss_request( +def build_try_planned_before_forced_failover_request( resource_group_name: str, server_name: str, failover_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/tryPlannedBeforeForcedFailover", ) # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -298,6 +312,86 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> Iterable["_models.FailoverGroup"]: + """Lists the failover groups in a server. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param server_name: The name of the server containing the failover group. Required. + :type server_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either FailoverGroup or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + cls: ClsType[_models.FailoverGroupListResult] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_server.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + request = HttpRequest("GET", next_link) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("FailoverGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list_by_server.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups" + } + @distributed_trace def get( self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any @@ -327,9 +421,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) request = build_get_request( @@ -386,16 +478,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) 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 _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "FailoverGroup") @@ -561,9 +651,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -623,9 +711,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -687,9 +773,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -749,16 +833,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) 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 _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "FailoverGroupUpdate") @@ -921,9 +1003,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -969,88 +1049,6 @@ def get_long_running_output(pipeline_response): "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" } - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> Iterable["_models.FailoverGroup"]: - """Lists the failover groups in a server. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. Required. - :type resource_group_name: str - :param server_name: The name of the server containing the failover group. Required. - :type server_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either FailoverGroup or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.FailoverGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) - cls: ClsType[_models.FailoverGroupListResult] = kwargs.pop("cls", None) - - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_server.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - request = HttpRequest("GET", next_link) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FailoverGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - 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 ) -> Optional[_models.FailoverGroup]: @@ -1065,9 +1063,7 @@ def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) request = build_failover_request( @@ -1136,9 +1132,7 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1195,9 +1189,7 @@ def _force_failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) request = build_force_failover_allow_data_loss_request( @@ -1267,9 +1259,7 @@ def begin_force_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1311,3 +1301,136 @@ def get_long_running_output(pipeline_response): begin_force_failover_allow_data_loss.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" } + + def _try_planned_before_forced_failover_initial( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> Optional[_models.FailoverGroup]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + cls: ClsType[Optional[_models.FailoverGroup]] = kwargs.pop("cls", None) + + request = build_try_planned_before_forced_failover_request( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._try_planned_before_forced_failover_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("FailoverGroup", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _try_planned_before_forced_failover_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/tryPlannedBeforeForcedFailover" + } + + @distributed_trace + def begin_try_planned_before_forced_failover( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> LROPoller[_models.FailoverGroup]: + """Fails over from the current primary server to this server. This operation tries planned before + forced failover but might still result in data loss. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either FailoverGroup or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._try_planned_before_forced_failover_initial( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("FailoverGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_try_planned_before_forced_failover.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/tryPlannedBeforeForcedFailover" + } 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 f2289fd21d59..acded5eb4f57 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +42,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,9 +74,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -116,9 +108,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -145,9 +135,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,9 +166,7 @@ def build_replace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -256,9 +242,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) request = build_get_request( @@ -398,16 +382,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "FirewallRule") @@ -483,9 +465,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -538,9 +518,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.FirewallRuleListResult] = kwargs.pop("cls", None) error_map = { @@ -689,16 +667,14 @@ def replace( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.FirewallRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "FirewallRuleList") 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 dd2b8fad5dce..5434db445a70 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,7 +47,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -92,7 +88,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,7 +121,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: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -283,14 +279,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "GeoBackupPolicy") @@ -374,7 +370,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -434,7 +430,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.GeoBackupPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 48cbac4bd0dc..62e0268827a0 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,9 +75,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,9 +107,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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") @@ -151,9 +141,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -180,9 +168,7 @@ def build_failover_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,9 +200,7 @@ 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: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -281,9 +265,7 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.InstanceFailoverGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -373,9 +355,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) request = build_get_request( @@ -432,16 +412,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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.InstanceFailoverGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "InstanceFailoverGroup") @@ -607,9 +585,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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.InstanceFailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -669,9 +645,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -733,9 +707,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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) @@ -790,9 +762,7 @@ def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[Optional[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) request = build_failover_request( @@ -861,9 +831,7 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) 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) @@ -920,9 +888,7 @@ def _force_failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[Optional[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) request = build_force_failover_allow_data_loss_request( @@ -992,9 +958,7 @@ def begin_force_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pools_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pools_operations.py index 809d5cc59820..0605b5026ea4 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,9 +75,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -116,9 +108,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -144,9 +134,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -178,9 +166,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,9 +194,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -274,9 +258,7 @@ def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) request = build_get_request( @@ -331,16 +313,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.InstancePool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "InstancePool") @@ -496,9 +476,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -557,9 +535,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -616,9 +592,7 @@ def begin_delete(self, resource_group_name: str, instance_pool_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -676,16 +650,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.InstancePool]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "InstancePoolUpdate") @@ -838,9 +810,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -900,9 +870,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) error_map = { @@ -974,9 +942,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.InstancePool"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) error_map = { 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 19d8132c7a28..70eef2eec70b 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +42,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: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,9 +73,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,9 +105,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -149,9 +139,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -210,9 +198,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.IPv6FirewallRuleListResult] = kwargs.pop("cls", None) error_map = { @@ -302,9 +288,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) request = build_get_request( @@ -446,16 +430,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "IPv6FirewallRule") @@ -531,9 +513,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 d8f3cab824b6..dcd326e7cc65 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,9 +75,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,9 +107,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -151,9 +141,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -180,9 +168,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -247,9 +233,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobAgentListResult] = kwargs.pop("cls", None) error_map = { @@ -337,9 +321,7 @@ def get(self, resource_group_name: str, server_name: str, job_agent_name: str, * _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) request = build_get_request( @@ -396,16 +378,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.JobAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "JobAgent") @@ -568,9 +548,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -630,9 +608,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -694,9 +670,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -756,16 +730,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.JobAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "JobAgentUpdate") @@ -925,9 +897,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_credentials_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_credentials_operations.py index 641fb30155ab..fb4ef5d845a7 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +42,7 @@ def build_list_by_agent_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,9 +79,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,9 +117,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -167,9 +157,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -231,9 +219,7 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobCredentialListResult] = kwargs.pop("cls", None) error_map = { @@ -326,9 +312,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) request = build_get_request( @@ -478,16 +462,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "JobCredential") @@ -566,9 +548,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 7b1ccae776de..bd5c0237b8da 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_executions_operations.py @@ -7,7 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -32,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -61,9 +56,7 @@ def build_list_by_agent_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,9 +107,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -145,9 +136,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,9 +182,7 @@ def build_list_by_job_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -248,9 +235,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -290,9 +275,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -390,9 +373,7 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { @@ -500,9 +481,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( @@ -552,9 +531,7 @@ def _create_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[Optional[_models.JobExecution]] = kwargs.pop("cls", None) request = build_create_request( @@ -626,9 +603,7 @@ def begin_create( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) 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) @@ -726,9 +701,7 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { @@ -837,9 +810,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( @@ -899,9 +870,7 @@ def _create_or_update_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[Optional[_models.JobExecution]] = kwargs.pop("cls", None) request = build_create_or_update_request( @@ -985,9 +954,7 @@ def begin_create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) 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) 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 46a7876f5aa2..a2395fec4ea6 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_step_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_step_executions_operations.py @@ -7,7 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -61,9 +56,7 @@ def build_list_by_job_execution_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,9 +111,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -225,9 +216,7 @@ def list_by_job_execution( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { @@ -340,9 +329,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( 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 f7d7754c86cd..bca2df2e4828 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +48,7 @@ def build_list_by_version_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -95,9 +89,7 @@ def build_get_by_version_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,9 +124,7 @@ def build_list_by_job_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,9 +163,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,9 +203,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -259,9 +245,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -334,9 +318,7 @@ def list_by_version( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) error_map = { @@ -442,9 +424,7 @@ def get_by_version( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) request = build_get_by_version_request( @@ -508,9 +488,7 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) error_map = { @@ -612,9 +590,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) request = build_get_request( @@ -774,16 +750,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "JobStep") @@ -871,9 +845,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 94f949833187..4a034b937416 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py @@ -7,7 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -30,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -61,9 +56,7 @@ def build_list_by_job_execution_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -126,9 +119,7 @@ def build_list_by_step_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -185,9 +176,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -293,9 +282,7 @@ def list_by_job_execution( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { @@ -426,9 +413,7 @@ def list_by_step( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map = { @@ -545,9 +530,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) request = build_get_request( 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 39fb41a6416a..9266c376f780 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +42,7 @@ def build_list_by_agent_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,9 +79,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,9 +117,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -167,9 +157,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -231,9 +219,7 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobTargetGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -326,9 +312,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) request = build_get_request( @@ -478,16 +462,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "JobTargetGroup") @@ -566,9 +548,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 0d2c95dd5d57..ff8e56d6be14 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_versions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_versions_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +41,7 @@ def build_list_by_job_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,9 +80,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -159,9 +150,7 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobVersionListResult] = kwargs.pop("cls", None) error_map = { @@ -263,9 +252,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobVersion] = kwargs.pop("cls", None) request = build_get_request( 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 ce8a47d3405d..aa59028ddc9e 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +42,7 @@ def build_list_by_agent_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,9 +74,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,9 +107,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -152,9 +142,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -216,9 +204,7 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.JobListResult] = kwargs.pop("cls", None) error_map = { @@ -311,9 +297,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.Job] = kwargs.pop("cls", None) request = build_get_request( @@ -462,16 +446,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Job] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Job") @@ -550,9 +532,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 200036668f6b..b632450ba31f 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,9 +49,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,9 +87,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,9 +123,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: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,9 +160,7 @@ def build_disable_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -254,9 +242,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) request = build_get_request( @@ -315,16 +301,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.LedgerDigestUploads]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "LedgerDigestUploads") @@ -499,9 +483,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -569,9 +551,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.LedgerDigestUploadsListResult] = kwargs.pop("cls", None) error_map = { @@ -652,9 +632,7 @@ def _disable_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[Optional[_models.LedgerDigestUploads]] = kwargs.pop("cls", None) request = build_disable_request( @@ -732,9 +710,7 @@ def begin_disable( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py index 638428dbc167..26c8e8af3629 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,9 +49,7 @@ def build_copy_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -100,9 +94,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -147,9 +139,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -190,9 +180,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -231,9 +219,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: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -280,9 +266,7 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,9 +308,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: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -371,9 +353,7 @@ def build_copy_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -420,9 +400,7 @@ def build_update_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -469,9 +447,7 @@ def build_get_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -514,9 +490,7 @@ def build_delete_by_resource_group_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -557,9 +531,7 @@ 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: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -608,9 +580,7 @@ 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: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -654,9 +624,7 @@ 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: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -729,16 +697,14 @@ def _copy_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CopyLongTermRetentionBackupParameters") @@ -911,9 +877,7 @@ def begin_copy( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackupOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -980,16 +944,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "UpdateLongTermRetentionBackupParameters") @@ -1162,9 +1124,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackupOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1246,9 +1206,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_request( @@ -1306,9 +1264,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -1377,9 +1333,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-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) @@ -1454,9 +1408,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -1547,9 +1499,7 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -1641,9 +1591,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -1727,16 +1675,14 @@ def _copy_by_resource_group_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CopyLongTermRetentionBackupParameters") @@ -1922,9 +1868,7 @@ def begin_copy_by_resource_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackupOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1993,16 +1937,14 @@ def _update_by_resource_group_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.LongTermRetentionBackupOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "UpdateLongTermRetentionBackupParameters") @@ -2188,9 +2130,7 @@ def begin_update_by_resource_group( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackupOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2277,9 +2217,7 @@ def get_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_by_resource_group_request( @@ -2339,9 +2277,7 @@ 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: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_by_resource_group_request( @@ -2415,9 +2351,7 @@ def begin_delete_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-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) @@ -2497,9 +2431,7 @@ def list_by_resource_group_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -2595,9 +2527,7 @@ def list_by_resource_group_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -2694,9 +2624,7 @@ def list_by_resource_group_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 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 2c605f3b7ff9..e0fee7ac15bd 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_managed_instance_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_managed_instance_backups_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -31,10 +30,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,9 +48,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,9 +85,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -129,9 +120,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: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,9 +164,7 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -219,9 +206,7 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -263,9 +248,7 @@ def build_get_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -304,9 +287,7 @@ def build_delete_by_resource_group_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -343,9 +324,7 @@ 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: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -391,9 +370,7 @@ 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: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -437,9 +414,7 @@ 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: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -519,9 +494,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_request( @@ -574,9 +547,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -640,9 +611,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-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) @@ -718,9 +687,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -815,9 +782,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -908,9 +873,7 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -1011,9 +974,7 @@ def get_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) request = build_get_by_resource_group_request( @@ -1073,9 +1034,7 @@ 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: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_by_resource_group_request( @@ -1149,9 +1108,7 @@ def begin_delete_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-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) @@ -1232,9 +1189,7 @@ def list_by_resource_group_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -1334,9 +1289,7 @@ def list_by_resource_group_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { @@ -1432,9 +1385,7 @@ def list_by_resource_group_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map = { 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 58845b65dee3..a59e8807b2b3 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,9 +49,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,9 +87,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,9 +123,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,9 +204,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.LongTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -275,16 +263,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.LongTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "LongTermRetentionPolicy") @@ -457,9 +443,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -528,9 +512,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.LongTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 6edfc6203b09..2c2b810b2f65 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_window_options_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_window_options_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,9 +46,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -138,9 +131,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.MaintenanceWindowOptions] = kwargs.pop("cls", None) request = build_get_request( 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 438b78cd8c4f..7cadc2c69397 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,9 +47,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,9 +86,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -176,9 +168,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.MaintenanceWindows] = kwargs.pop("cls", None) request = build_get_request( @@ -327,16 +317,14 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "MaintenanceWindows") 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 4a9afc372c48..fb33ef636102 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,9 +49,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,9 +87,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -136,9 +128,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -174,9 +164,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,9 +245,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -318,16 +304,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedBackupShortTermRetentionPolicy") @@ -503,9 +487,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -572,16 +554,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedBackupShortTermRetentionPolicy") @@ -757,9 +737,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -829,9 +807,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 1112f1410a6b..b5614e0c64c3 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +42,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: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,9 +79,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,9 +119,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -203,9 +193,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { @@ -305,9 +293,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( @@ -463,16 +449,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedDatabaseAdvancedThreatProtection") 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 0274fb7e1093..3ca6a0d8a1d7 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_columns_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_columns_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -56,9 +51,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,9 +101,7 @@ def build_list_by_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,9 +144,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -244,9 +233,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { @@ -348,9 +335,7 @@ def list_by_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map = { @@ -457,9 +442,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) request = build_get_request( 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 c47399bef173..03ec1370edaf 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_move_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_move_operations_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +47,7 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,9 +84,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,9 +160,7 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.ManagedDatabaseMoveOperationListResult] = kwargs.pop("cls", None) error_map = { @@ -263,9 +252,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.ManagedDatabaseMoveOperationResult] = kwargs.pop("cls", None) request = build_get_request( 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 a12aa87fc41c..ee13ee1de6f7 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_queries_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_queries_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,9 +46,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -95,9 +88,7 @@ def build_list_by_query_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,9 +171,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceQuery] = kwargs.pop("cls", None) request = build_get_request( @@ -259,9 +248,7 @@ def list_by_query( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceQueryStatistics] = kwargs.pop("cls", None) error_map = { 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 2497c05adafb..3b75de4047cc 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,9 +41,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -194,16 +188,14 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "RecommendedSensitivityLabelUpdateList") 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 454132a81daf..dac0d66c1bb9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_restore_details_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_restore_details_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,9 +45,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,9 +127,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.ManagedDatabaseRestoreDetailsResult] = kwargs.pop("cls", None) request = build_get_request( 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 aa2f3292b370..b40a34f38d31 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_schemas_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_schemas_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +47,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,9 +86,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,9 +161,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) error_map = { @@ -266,9 +255,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) request = build_get_request( 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 eb568d24ac61..5f62485ac10b 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,9 +47,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,9 +85,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -129,9 +121,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,9 +203,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -368,16 +356,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedDatabaseSecurityAlertPolicy") @@ -448,9 +434,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 eb30a7f95bf1..36381ae686d9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -55,9 +50,7 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,9 +143,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SecurityEventCollection] = kwargs.pop("cls", None) error_map = { 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 3fea2d4b2407..94395944d57a 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload @@ -54,9 +55,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,9 +99,7 @@ def build_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) 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") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -148,9 +145,7 @@ def build_delete_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) 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") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -188,9 +183,7 @@ def build_disable_recommendation_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) 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") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -228,9 +221,7 @@ def build_enable_recommendation_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) 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") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -269,9 +260,7 @@ def build_list_current_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -309,9 +298,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -351,9 +338,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -452,9 +437,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) request = build_get_request( @@ -635,16 +618,14 @@ def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SensitivityLabel") @@ -741,9 +722,7 @@ def delete( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -827,9 +806,7 @@ def disable_recommendation( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_disable_recommendation_request( @@ -914,9 +891,7 @@ def enable_recommendation( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_enable_recommendation_request( @@ -989,9 +964,7 @@ def list_current_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { @@ -1157,16 +1130,14 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SensitivityLabelUpdateList") @@ -1241,9 +1212,7 @@ def list_recommended_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { 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 a9f5d0571be6..7b6f61ebccf4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_tables_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_tables_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,9 +48,7 @@ def build_list_by_schema_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,9 +89,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,9 +168,7 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) error_map = { @@ -282,9 +271,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) request = build_get_request( 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 3bd1c98c8b1c..1931bd1d4255 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,9 +47,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,9 +85,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -129,9 +121,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -213,9 +203,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) request = build_get_request( @@ -368,16 +356,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedTransparentDataEncryption") @@ -448,9 +434,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedTransparentDataEncryptionListResult] = kwargs.pop("cls", None) error_map = { 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 d72821f383ab..ad109c720b85 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +48,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,9 +92,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -146,9 +138,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -239,9 +229,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( @@ -423,16 +411,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseVulnerabilityAssessmentRuleBaseline") @@ -524,9 +510,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 f99c832c7d4d..e7155af3faca 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -31,10 +30,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,9 +48,7 @@ def build_initiate_scan_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -92,9 +85,7 @@ def build_export_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -135,9 +126,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -178,9 +167,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -249,9 +236,7 @@ def _initiate_scan_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_initiate_scan_request( @@ -326,9 +311,7 @@ def begin_initiate_scan( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -411,9 +394,7 @@ def export( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) request = build_export_request( @@ -487,9 +468,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { @@ -592,9 +571,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( 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 2fc1effbaa46..1043726580d0 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,9 +47,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,9 +87,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -137,9 +129,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -169,9 +159,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -254,9 +242,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( @@ -412,16 +398,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseVulnerabilityAssessment") @@ -507,9 +491,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -567,9 +549,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 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 06dd8d8fa8bf..ce7e7f8a33e1 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,9 +75,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,9 +107,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -151,9 +141,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -180,9 +168,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -217,9 +203,7 @@ def build_cancel_move_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -251,9 +235,7 @@ def build_complete_move_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -285,9 +267,7 @@ def build_complete_restore_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -319,9 +299,7 @@ def build_start_move_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -353,9 +331,7 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -418,9 +394,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { @@ -510,9 +484,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( @@ -569,16 +541,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedDatabase]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedDatabase") @@ -744,9 +714,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -806,9 +774,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -870,9 +836,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -932,16 +896,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedDatabase]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedDatabaseUpdate") @@ -1104,9 +1066,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1171,16 +1131,14 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedDatabaseMoveDefinition") @@ -1334,9 +1292,7 @@ def begin_cancel_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1399,16 +1355,14 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedDatabaseMoveDefinition") @@ -1562,9 +1516,7 @@ def begin_complete_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1627,16 +1579,14 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CompleteDatabaseRestoreDefinition") @@ -1792,9 +1742,7 @@ def begin_complete_restore( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1857,16 +1805,14 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedDatabaseStartMoveDefinition") @@ -2020,9 +1966,7 @@ def begin_start_move( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2085,9 +2029,7 @@ def list_inaccessible_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 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 d87579e9a65e..4853285cd4f6 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,9 +79,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,9 +115,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -163,9 +153,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -225,9 +213,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceAdministratorListResult] = kwargs.pop("cls", None) error_map = { @@ -321,9 +307,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceAdministrator] = kwargs.pop("cls", None) request = build_get_request( @@ -380,16 +364,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstanceAdministrator]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceAdministrator") @@ -555,9 +537,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceAdministrator] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -621,9 +601,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -689,9 +667,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 f3796461d79f..8e3b8145223e 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,9 +79,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,9 +117,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -198,9 +188,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ManagedInstanceAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { @@ -296,9 +284,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( @@ -355,16 +341,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) 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 _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceAdvancedThreatProtection") @@ -536,9 +520,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_azure_ad_only_authentications_operations.py index cc4ce7b3f3f2..efac13d249a1 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +48,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,9 +84,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -130,9 +122,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -159,9 +149,7 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -239,9 +227,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = kwargs.pop("cls", None) request = build_get_request( @@ -298,16 +284,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstanceAzureADOnlyAuthentication]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceAzureADOnlyAuthentication") @@ -485,9 +469,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -551,9 +533,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -620,9 +600,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -684,9 +662,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] = kwargs.pop("cls", None) error_map = { 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 061f1b28d596..cff82072a4c1 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_managed_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,9 +79,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,9 +115,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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") @@ -192,9 +182,7 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.ManagedInstanceDtcListResult] = kwargs.pop("cls", None) error_map = { @@ -284,9 +272,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) request = build_get_request( @@ -343,16 +329,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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.ManagedInstanceDtc] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceDtc") @@ -513,9 +497,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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.ManagedInstanceDtc] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_encryption_protectors_operations.py index 46f5df2aed94..019fed2fd4ce 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,9 +47,7 @@ def build_revalidate_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -80,9 +74,7 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -117,9 +109,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,9 +145,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -223,9 +211,7 @@ def _revalidate_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_revalidate_request( @@ -292,9 +278,7 @@ def begin_revalidate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -355,9 +339,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceEncryptionProtectorListResult] = kwargs.pop("cls", None) error_map = { @@ -452,9 +434,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceEncryptionProtector] = kwargs.pop("cls", None) request = build_get_request( @@ -511,16 +491,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstanceEncryptionProtector]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceEncryptionProtector") @@ -689,9 +667,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceEncryptionProtector] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_keys_operations.py index c569afcb3302..ccbd3cc70a1d 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,9 +49,7 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,9 +82,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -122,9 +114,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -158,9 +148,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -222,9 +210,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceKeyListResult] = kwargs.pop("cls", None) error_map = { @@ -315,9 +301,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceKey] = kwargs.pop("cls", None) request = build_get_request( @@ -374,16 +358,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstanceKey]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceKey") @@ -552,9 +534,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceKey] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -614,9 +594,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -678,9 +656,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 d19162d7a06b..171f4da51ff1 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,9 +49,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,9 +87,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,9 +123,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,9 +204,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -275,16 +263,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstanceLongTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceLongTermRetentionPolicy") @@ -460,9 +446,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -532,9 +516,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 5d571b983b7f..434ba352fd39 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_operations_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +41,7 @@ def build_list_by_managed_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,9 +72,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,9 +103,7 @@ def build_cancel_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -174,9 +163,7 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceOperationListResult] = kwargs.pop("cls", None) error_map = { @@ -266,9 +253,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceOperation] = kwargs.pop("cls", None) request = build_get_request( @@ -335,9 +320,7 @@ def cancel( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_request( 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 c009e7b551aa..c831011ce96f 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +48,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,9 +86,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -134,9 +126,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -165,9 +155,7 @@ def build_list_by_managed_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -240,9 +228,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = kwargs.pop("cls", None) request = build_get_request( @@ -299,16 +285,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstancePrivateEndpointConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstancePrivateEndpointConnection") @@ -474,9 +458,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -536,9 +518,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -600,9 +580,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -664,9 +642,7 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { 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 68ae445a8097..56ac3c197285 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +41,7 @@ def build_list_by_managed_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,9 +72,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,9 +137,7 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstancePrivateLinkListResult] = kwargs.pop("cls", None) error_map = { @@ -238,9 +227,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstancePrivateLink] = kwargs.pop("cls", None) request = build_get_request( 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 d69df779cefe..b607e50f619a 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -30,10 +30,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,9 +43,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -111,16 +105,14 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "TdeCertificate") @@ -264,9 +256,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_vulnerability_assessments_operations.py index 2079ee9b94e9..e87d82c6a707 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,9 +46,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,9 +84,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -132,9 +124,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -163,9 +153,7 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -244,9 +232,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( @@ -398,16 +384,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceVulnerabilityAssessment") @@ -489,9 +473,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -547,9 +529,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 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 22b31439f403..98a46dc96704 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +42,7 @@ def build_list_request(subscription_id: str, *, expand: Optional[str] = None, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,9 +75,7 @@ def build_list_by_instance_pool_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,9 +108,7 @@ def build_list_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,9 +145,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -190,9 +178,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -225,9 +211,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -253,9 +237,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -293,9 +275,7 @@ def build_failover_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -323,9 +303,7 @@ def build_list_outbound_network_dependencies_by_managed_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -355,9 +333,7 @@ def build_start_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -382,9 +358,7 @@ def build_stop_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -421,9 +395,7 @@ def build_list_by_managed_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -495,9 +467,7 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { @@ -576,9 +546,7 @@ def list_by_instance_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { @@ -659,9 +627,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map = { @@ -751,9 +717,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) request = build_get_request( @@ -809,16 +773,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstance") @@ -974,9 +936,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1035,9 +995,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -1094,9 +1052,7 @@ def begin_delete(self, resource_group_name: str, managed_instance_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1154,16 +1110,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedInstance]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedInstanceUpdate") @@ -1316,9 +1270,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1381,9 +1333,7 @@ def _failover_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_failover_request( @@ -1450,9 +1400,7 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1513,9 +1461,7 @@ def list_outbound_network_dependencies_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) error_map = { @@ -1590,9 +1536,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_start_request( @@ -1649,9 +1593,7 @@ def begin_start(self, resource_group_name: str, managed_instance_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1707,9 +1649,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_stop_request( @@ -1766,9 +1706,7 @@ def begin_stop(self, resource_group_name: str, managed_instance_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1858,9 +1796,7 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.TopQueriesListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_ledger_digest_uploads_operations.py index b8a2cb3c4fb8..1a1b673739ca 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_ledger_digest_uploads_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_ledger_digest_uploads_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,9 +81,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,9 +119,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -170,9 +160,7 @@ def build_disable_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -240,9 +228,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedLedgerDigestUploadsListResult] = kwargs.pop("cls", None) error_map = { @@ -340,9 +326,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedLedgerDigestUploads] = kwargs.pop("cls", None) request = build_get_request( @@ -401,16 +385,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedLedgerDigestUploads]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedLedgerDigestUploads") @@ -589,9 +571,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedLedgerDigestUploads] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -657,9 +637,7 @@ def _disable_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[Optional[_models.ManagedLedgerDigestUploads]] = kwargs.pop("cls", None) request = build_disable_request( @@ -737,9 +715,7 @@ def begin_disable( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ManagedLedgerDigestUploads] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py index 4e730b8d2dc4..982beb319e81 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,9 +49,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -95,9 +89,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -140,9 +132,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -184,9 +174,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -269,9 +257,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -330,16 +316,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedBackupShortTermRetentionPolicy") @@ -515,9 +499,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -584,16 +566,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedBackupShortTermRetentionPolicy") @@ -769,9 +749,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -841,9 +819,7 @@ def list_by_restorable_dropped_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 795e556319d1..a94080c63694 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_managed_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,9 +75,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,9 +107,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -151,9 +141,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -180,9 +168,7 @@ def build_acquire_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -250,9 +236,7 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ManagedServerDnsAliasListResult] = kwargs.pop("cls", None) error_map = { @@ -342,9 +326,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) request = build_get_request( @@ -401,16 +383,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedServerDnsAliasCreation") @@ -575,9 +555,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -637,9 +615,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -701,9 +677,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -763,16 +737,14 @@ def _acquire_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedServerDnsAliasAcquisition") @@ -934,9 +906,7 @@ def begin_acquire( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py index 7d44777a6c97..8cfe615b19ca 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +48,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,9 +84,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -127,9 +119,7 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,9 +196,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -265,16 +253,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ManagedServerSecurityAlertPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ManagedServerSecurityAlertPolicy") @@ -437,9 +423,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -505,9 +489,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 b4e7d1ac8d89..758af7344028 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,9 +39,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,9 +85,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { 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 1406bc4ab193..5dfa007dcae1 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,9 +76,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -118,9 +110,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -147,9 +137,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: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,9 +210,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.OutboundFirewallRule] = kwargs.pop("cls", None) request = build_get_request( @@ -281,16 +267,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.OutboundFirewallRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "OutboundFirewallRule") @@ -455,9 +439,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.OutboundFirewallRule] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -517,9 +499,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -581,9 +561,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-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) @@ -644,9 +622,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.OutboundFirewallRuleListResult] = kwargs.pop("cls", None) error_map = { 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 042e924f3172..67b7a08eac50 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +48,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,9 +86,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -134,9 +126,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -165,9 +155,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -240,9 +228,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) request = build_get_request( @@ -299,16 +285,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "PrivateEndpointConnection") @@ -470,9 +454,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -532,9 +514,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -596,9 +576,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -659,9 +637,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { 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 7ffaa32d0d4c..0bd187f64289 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_link_resources_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +41,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,9 +72,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -145,9 +136,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -237,9 +226,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) request = build_get_request( 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 4f9de30be067..f8090c8c4c40 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,9 +41,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -194,16 +188,14 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "RecommendedSensitivityLabelUpdateList") 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 aa45945feb5e..d0220497baf5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_databases_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +41,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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,9 +79,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -156,9 +147,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.RecoverableDatabaseListResult] = kwargs.pop("cls", None) error_map = { @@ -259,9 +248,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.RecoverableDatabase] = kwargs.pop("cls", None) request = build_get_request( 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 5bcdfac5d08c..0caf42fbb7eb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_managed_databases_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +41,7 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,9 +76,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,9 +141,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.RecoverableManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { @@ -242,9 +231,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.RecoverableManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( 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 b89b2790f7e3..61d794ca76bb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -31,10 +30,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +43,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: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,9 +75,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,9 +107,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -146,9 +135,7 @@ def build_failover_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,9 +168,7 @@ def build_failover_allow_data_loss_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,9 +201,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: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -283,9 +266,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) error_map = { @@ -378,9 +359,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) request = build_get_request( @@ -433,9 +412,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -500,9 +477,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-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) @@ -558,9 +533,7 @@ def _failover_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) request = build_failover_request( @@ -632,9 +605,7 @@ def begin_failover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -692,9 +663,7 @@ def _failover_allow_data_loss_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[Optional[_models.ReplicationLink]] = kwargs.pop("cls", None) request = build_failover_allow_data_loss_request( @@ -766,9 +735,7 @@ def begin_failover_allow_data_loss( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -831,9 +798,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) error_map = { 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 2db5c44b9e85..f99810aa5561 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_databases_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +41,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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,9 +79,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -159,9 +150,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.RestorableDroppedDatabaseListResult] = kwargs.pop("cls", None) error_map = { @@ -262,9 +251,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.RestorableDroppedDatabase] = kwargs.pop("cls", None) request = build_get_request( 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 69b3cf1b24fd..be148711f783 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_managed_databases_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +41,7 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,9 +76,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,9 +143,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.RestorableDroppedManagedDatabaseListResult] = kwargs.pop("cls", None) error_map = { @@ -244,9 +233,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.RestorableDroppedManagedDatabase] = kwargs.pop("cls", None) request = build_get_request( 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 2255a192cfb3..30bdabcefe2b 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,9 +76,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -124,9 +116,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,9 +153,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -227,9 +215,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.RestorePointListResult] = kwargs.pop("cls", None) error_map = { @@ -310,16 +296,14 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.RestorePoint]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CreateDatabaseRestorePointDefinition") @@ -485,9 +469,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.RestorePoint] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -564,9 +546,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.RestorePoint] = kwargs.pop("cls", None) request = build_get_request( @@ -636,9 +616,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 a51d342d2480..59e23e85823d 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload @@ -54,9 +55,7 @@ def build_list_current_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,9 +93,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -136,9 +133,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -185,9 +180,7 @@ def build_enable_recommendation_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) 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") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -225,9 +218,7 @@ def build_disable_recommendation_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) 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") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -266,9 +257,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,9 +301,7 @@ def build_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) 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") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -360,9 +347,7 @@ def build_delete_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) 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") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -441,9 +426,7 @@ def list_current_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { @@ -609,16 +592,14 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SensitivityLabelUpdateList") @@ -693,9 +674,7 @@ def list_recommended_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map = { @@ -807,9 +786,7 @@ def enable_recommendation( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_enable_recommendation_request( @@ -893,9 +870,7 @@ def disable_recommendation( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_disable_recommendation_request( @@ -979,9 +954,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) request = build_get_request( @@ -1162,16 +1135,14 @@ def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SensitivityLabel") @@ -1268,9 +1239,7 @@ def delete( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 75a184ad6add..dfaa4cf74041 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,9 +79,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,9 +117,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -197,9 +187,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.LogicalServerAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map = { @@ -295,9 +283,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ServerAdvancedThreatProtection] = kwargs.pop("cls", None) request = build_get_request( @@ -354,16 +340,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerAdvancedThreatProtection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerAdvancedThreatProtection") @@ -532,9 +516,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerAdvancedThreatProtection] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advisors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advisors_operations.py index 6997cc2763f2..85f6daedb3b5 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,9 +41,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,9 +74,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,9 +106,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -193,9 +183,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) request = build_list_by_server_request( @@ -260,9 +248,7 @@ def get(self, resource_group_name: str, server_name: str, advisor_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) request = build_get_request( @@ -402,16 +388,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Advisor") 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 78ef6a64a3f4..3cb8ee6c862a 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,9 +39,7 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,9 +70,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -150,9 +142,7 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) request = build_get_request( @@ -282,16 +272,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerAutomaticTuning") 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 1eacb626b52f..4bb4fc540c60 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +48,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,9 +84,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -130,9 +122,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -159,9 +149,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -239,9 +227,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerAzureADAdministrator] = kwargs.pop("cls", None) request = build_get_request( @@ -298,16 +284,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerAzureADAdministrator]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerAzureADAdministrator") @@ -476,9 +460,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerAzureADAdministrator] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -542,9 +524,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -611,9 +591,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -674,9 +652,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.AdministratorListResult] = kwargs.pop("cls", None) error_map = { 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 cdffb991ac31..19bd1b253f28 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +48,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,9 +84,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -130,9 +122,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -159,9 +149,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -239,9 +227,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerAzureADOnlyAuthentication] = kwargs.pop("cls", None) request = build_get_request( @@ -298,16 +284,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerAzureADOnlyAuthentication]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerAzureADOnlyAuthentication") @@ -482,9 +466,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerAzureADOnlyAuthentication] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -548,9 +530,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -617,9 +597,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -680,9 +658,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.AzureADOnlyAuthListResult] = kwargs.pop("cls", None) error_map = { 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 720032c9f90c..22ba2ea1dddd 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload @@ -48,9 +49,7 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,9 +79,7 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,9 +112,7 @@ def build_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -185,9 +180,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map = { @@ -277,9 +270,7 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ServerBlobAuditingPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -336,16 +327,14 @@ def _create_or_update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerBlobAuditingPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerBlobAuditingPolicy") @@ -509,9 +498,7 @@ def begin_create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerBlobAuditingPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py index 9136cfb8a9d8..2de8795d920e 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +43,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -74,7 +70,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +102,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -141,7 +137,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: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +210,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -277,7 +273,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ServerCommunicationLink] = kwargs.pop("cls", None) request = build_get_request( @@ -334,14 +330,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerCommunicationLink]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerCommunicationLink") @@ -504,7 +500,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerCommunicationLink] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -570,7 +566,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ServerCommunicationLinkListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_configuration_options_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_configuration_options_operations.py index e83885f2befb..ffd17399212b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_configuration_options_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_configuration_options_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_managed_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,9 +79,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,9 +117,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -197,9 +187,7 @@ def list_by_managed_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ServerConfigurationOptionListResult] = kwargs.pop("cls", None) error_map = { @@ -295,9 +283,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ServerConfigurationOption] = kwargs.pop("cls", None) request = build_get_request( @@ -354,16 +340,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerConfigurationOption] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerConfigurationOption") @@ -530,9 +514,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerConfigurationOption] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py index f2c4c364137b..04d259e28a30 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +48,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,9 +84,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -127,9 +119,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: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,9 +196,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ServerConnectionPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -265,16 +253,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerConnectionPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerConnectionPolicy") @@ -437,9 +423,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerConnectionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -505,9 +489,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) cls: ClsType[_models.ServerConnectionPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 39804aa852ef..d2aa5805dc25 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,9 +79,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,9 +117,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -197,9 +187,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ServerDevOpsAuditSettingsListResult] = kwargs.pop("cls", None) error_map = { @@ -293,9 +281,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) cls: ClsType[_models.ServerDevOpsAuditingSettings] = kwargs.pop("cls", None) request = build_get_request( @@ -352,16 +338,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) 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 _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerDevOpsAuditingSettings") @@ -524,9 +508,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerDevOpsAuditingSettings] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dns_aliases_operations.py index 20165d869d07..72c62a85618d 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,9 +76,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,9 +107,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -144,9 +134,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,9 +165,7 @@ def build_acquire_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -256,9 +242,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) request = build_get_request( @@ -310,9 +294,7 @@ def _create_or_update_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[Optional[_models.ServerDnsAlias]] = kwargs.pop("cls", None) request = build_create_or_update_request( @@ -384,9 +366,7 @@ def begin_create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) 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) @@ -443,9 +423,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -507,9 +485,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -569,9 +545,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerDnsAliasListResult] = kwargs.pop("cls", None) error_map = { @@ -651,16 +625,14 @@ def _acquire_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerDnsAlias]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerDnsAliasAcquisition") @@ -822,9 +794,7 @@ def begin_acquire( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_keys_operations.py index 654ebc50296b..9dda89a82a8f 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_server_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,9 +75,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,9 +107,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -151,9 +141,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -212,9 +200,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerKeyListResult] = kwargs.pop("cls", None) error_map = { @@ -302,9 +288,7 @@ def get(self, resource_group_name: str, server_name: str, key_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerKey] = kwargs.pop("cls", None) request = build_get_request( @@ -361,16 +345,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerKey]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerKey") @@ -542,9 +524,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerKey] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -604,9 +584,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -666,9 +644,7 @@ def begin_delete(self, resource_group_name: str, server_name: str, key_name: str _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 8be93e6e1148..cb55b0601cde 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +41,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,9 +104,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerOperationListResult] = kwargs.pop("cls", None) error_map = { 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 20cad287d16d..c390ea65dca2 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +48,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,9 +84,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -127,9 +119,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,9 +196,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerSecurityAlertPolicy] = kwargs.pop("cls", None) request = build_get_request( @@ -265,16 +253,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerSecurityAlertPolicy]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerSecurityAlertPolicy") @@ -437,9 +423,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerSecurityAlertPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -505,9 +489,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) error_map = { 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 789bb9bac90e..149d57197aee 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,9 +75,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,9 +107,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -151,9 +141,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -214,9 +202,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ServerTrustCertificatesListResult] = kwargs.pop("cls", None) error_map = { @@ -306,9 +292,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[_models.ServerTrustCertificate] = kwargs.pop("cls", None) request = build_get_request( @@ -365,16 +349,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerTrustCertificate]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerTrustCertificate") @@ -540,9 +522,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerTrustCertificate] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -602,9 +582,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -666,9 +644,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 72ed1e0ad8a4..3b4a7f1aa1e4 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,9 +76,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -118,9 +110,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -147,9 +137,7 @@ def build_list_by_location_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,9 +168,7 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -255,9 +241,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerTrustGroup] = kwargs.pop("cls", None) request = build_get_request( @@ -314,16 +298,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ServerTrustGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerTrustGroup") @@ -489,9 +471,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerTrustGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -551,9 +531,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -615,9 +593,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -677,9 +653,7 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) error_map = { @@ -759,9 +733,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) error_map = { 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 87b888e7620f..578e4a9f7e62 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_usages_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +41,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: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +104,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ServerUsageListResult] = kwargs.pop("cls", None) error_map = { 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 e45855df300a..fb7ce0adf229 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,9 +46,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,9 +84,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -132,9 +124,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -163,9 +153,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -244,9 +232,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( @@ -398,16 +384,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerVulnerabilityAssessment") @@ -489,9 +473,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -545,9 +527,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.ServerVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { 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 b649caf10419..7029d45bbc4d 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +42,7 @@ def build_check_name_availability_request(subscription_id: str, **kwargs: Any) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -75,9 +69,7 @@ def build_list_request(subscription_id: str, *, expand: Optional[str] = None, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,9 +97,7 @@ def build_list_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,9 +129,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,9 +162,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -209,9 +195,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -237,9 +221,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -273,9 +255,7 @@ def build_import_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -309,9 +289,7 @@ def build_refresh_status_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -417,16 +395,14 @@ def check_name_availability( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckNameAvailabilityResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CheckNameAvailabilityRequest") @@ -480,9 +456,7 @@ 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: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { @@ -559,9 +533,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map = { @@ -651,9 +623,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.Server] = kwargs.pop("cls", None) request = build_get_request( @@ -705,16 +675,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Server]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Server") @@ -863,9 +831,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Server] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -924,9 +890,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -983,9 +947,7 @@ def begin_delete(self, resource_group_name: str, server_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1039,16 +1001,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Server]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ServerUpdate") @@ -1194,9 +1154,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Server] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1259,16 +1217,14 @@ def _import_database_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ImportExportOperationResult]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ImportNewDatabaseDefinition") @@ -1421,9 +1377,7 @@ def begin_import_database( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ImportExportOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1482,9 +1436,7 @@ def _refresh_status_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[Optional[_models.RefreshExternalGovernanceStatusOperationResult]] = kwargs.pop("cls", None) request = build_refresh_status_request( @@ -1551,9 +1503,7 @@ def begin_refresh_status( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.RefreshExternalGovernanceStatusOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py index 9d5f7eee4343..a80cb0561f12 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +41,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +73,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: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -151,7 +146,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ServiceObjective] = kwargs.pop("cls", None) request = build_get_request( @@ -208,7 +203,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2014-04-01"] = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) cls: ClsType[_models.ServiceObjectiveListResult] = kwargs.pop("cls", None) error_map = { 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 9ef5096952b8..94d8455e855d 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -28,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,9 +41,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,9 +72,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -152,9 +144,7 @@ def get(self, resource_group_name: str, managed_instance_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) request = build_get_request( @@ -283,16 +273,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SqlAgentConfiguration") 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 37e3dacfbf75..5b4020b6bf6c 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 @@ -53,9 +53,7 @@ def build_list_by_sql_vulnerability_assessment_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,9 +96,7 @@ def build_get_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,9 +179,7 @@ def list_by_sql_vulnerability_assessment( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) error_map = { @@ -293,9 +287,7 @@ def get( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) request = build_get_request( 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 3febde812522..c80efb041fc6 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload @@ -53,9 +54,7 @@ def build_create_or_update_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -235,16 +234,14 @@ def create_or_update( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput") 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 fa810c9d4524..a2184932ae0e 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 @@ -53,9 +53,7 @@ def build_execute_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -119,9 +117,7 @@ def _execute_initial( # pylint: disable=inconsistent-return-statements system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_execute_request( @@ -195,9 +191,7 @@ def begin_execute( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 702eb5e023bd..a77652e96530 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 @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload @@ -54,9 +55,7 @@ def build_list_by_baseline_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,9 +100,7 @@ def build_get_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,9 +146,7 @@ def build_create_or_update_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -241,9 +236,7 @@ def list_by_baseline( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) error_map = { @@ -355,9 +348,7 @@ def get( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) request = build_get_request( @@ -534,16 +525,14 @@ def create_or_update( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput") 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 ae2d3cdeebd6..aeac964809e5 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 @@ -53,9 +53,7 @@ def build_delete_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -146,9 +144,7 @@ def delete( # pylint: disable=inconsistent-return-statements system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 df2eeaa85930..01c9c02580ce 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 @@ -43,7 +43,7 @@ def build_list_by_scan_request( resource_group_name: str, server_name: str, - vulnerability_assessment_name: Union[str, _models.SQLVulnerabilityAssessmentName], + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], scan_id: str, subscription_id: str, **kwargs: Any @@ -54,9 +54,7 @@ def build_list_by_scan_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +87,7 @@ def build_list_by_scan_request( def build_get_request( resource_group_name: str, server_name: str, - vulnerability_assessment_name: Union[str, _models.SQLVulnerabilityAssessmentName], + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], scan_id: str, scan_result_id: str, subscription_id: str, @@ -101,9 +99,7 @@ def build_get_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -158,7 +154,7 @@ def list_by_scan( self, resource_group_name: str, server_name: str, - vulnerability_assessment_name: Union[str, _models.SQLVulnerabilityAssessmentName], + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], scan_id: str, **kwargs: Any ) -> Iterable["_models.SqlVulnerabilityAssessmentScanResults"]: @@ -172,7 +168,7 @@ def list_by_scan( :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" Required. :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SQLVulnerabilityAssessmentName + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. Required. :type scan_id: str @@ -192,9 +188,7 @@ def list_by_scan( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) error_map = { @@ -263,7 +257,7 @@ def get( self, resource_group_name: str, server_name: str, - vulnerability_assessment_name: Union[str, _models.SQLVulnerabilityAssessmentName], + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], scan_id: str, scan_result_id: str, **kwargs: Any @@ -278,7 +272,7 @@ def get( :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" Required. :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SQLVulnerabilityAssessmentName + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. Required. :type scan_id: str @@ -306,9 +300,7 @@ def get( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) request = build_get_request( 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 c0d97d43a60d..bb4f6e2cc54d 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 @@ -53,9 +53,7 @@ def build_list_by_sql_vulnerability_assessments_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,9 +96,7 @@ def build_get_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,9 +179,7 @@ def list_by_sql_vulnerability_assessments( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map = { @@ -291,9 +285,7 @@ def get( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) request = build_get_request( 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 647f2a5b4d68..229eca0efc0f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ( @@ -28,10 +27,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +43,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -126,9 +119,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 742e608be50c..07144e4921ca 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +42,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: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,9 +77,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,9 +115,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -195,9 +185,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map = { @@ -293,9 +281,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( @@ -438,16 +424,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SqlVulnerabilityAssessment") diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_start_stop_managed_instance_schedules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_start_stop_managed_instance_schedules_operations.py index a80298f98398..0f8c9180b70a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_start_stop_managed_instance_schedules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_start_stop_managed_instance_schedules_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +42,7 @@ def build_list_by_instance_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,9 +77,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,9 +113,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -161,9 +151,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -223,9 +211,7 @@ def list_by_instance( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.StartStopManagedInstanceScheduleListResult] = kwargs.pop("cls", None) error_map = { @@ -320,9 +306,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.StartStopManagedInstanceSchedule] = kwargs.pop("cls", None) request = build_get_request( @@ -465,16 +449,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.StartStopManagedInstanceSchedule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "StartStopManagedInstanceSchedule") @@ -555,9 +537,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( 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 6faf70b81165..e4d090df7d94 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_subscription_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_subscription_usages_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,9 +39,7 @@ def build_list_by_location_request(location_name: str, subscription_id: str, **k _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,9 +66,7 @@ def build_get_request(location_name: str, usage_name: str, subscription_id: str, _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,9 +124,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SubscriptionUsageListResult] = kwargs.pop("cls", None) error_map = { @@ -219,9 +208,7 @@ def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.Sub _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SubscriptionUsage] = kwargs.pop("cls", None) request = build_get_request( 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 444144377bdf..98a3dfca99e9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_synapse_link_workspaces_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_synapse_link_workspaces_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +41,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: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,9 +108,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.SynapseLinkWorkspaceListResult] = kwargs.pop("cls", None) error_map = { 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 bae6f90030ad..293e6afa7ef6 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,9 +76,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -118,9 +110,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -147,9 +137,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,9 +168,7 @@ def build_generate_key_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,9 +200,7 @@ def build_list_linked_databases_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -288,9 +272,7 @@ def get(self, resource_group_name: str, server_name: str, sync_agent_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncAgent] = kwargs.pop("cls", None) request = build_get_request( @@ -347,16 +329,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.SyncAgent]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SyncAgent") @@ -519,9 +499,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncAgent] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -581,9 +559,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -645,9 +621,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -707,9 +681,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncAgentListResult] = kwargs.pop("cls", None) error_map = { @@ -799,9 +771,7 @@ def generate_key( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncAgentKeyProperties] = kwargs.pop("cls", None) request = build_generate_key_request( @@ -861,9 +831,7 @@ def list_linked_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncAgentLinkedDatabaseListResult] = kwargs.pop("cls", None) error_map = { 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 519b95b81fec..2645ae7fa449 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +42,7 @@ def build_list_sync_database_ids_request(location_name: str, subscription_id: st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,9 +76,7 @@ def build_refresh_hub_schema_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -117,9 +109,7 @@ def build_list_hub_schemas_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,9 +152,7 @@ def build_list_logs_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -208,9 +196,7 @@ def build_cancel_sync_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -242,9 +228,7 @@ def build_trigger_sync_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -277,9 +261,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -317,9 +299,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -359,9 +339,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -394,9 +372,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -432,9 +408,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -494,9 +468,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncDatabaseIdListResult] = kwargs.pop("cls", None) error_map = { @@ -570,9 +542,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_refresh_hub_schema_request( @@ -637,9 +607,7 @@ def begin_refresh_hub_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -705,9 +673,7 @@ def list_hub_schemas( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) error_map = { @@ -813,9 +779,7 @@ def list_logs( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncGroupLogListResult] = kwargs.pop("cls", None) error_map = { @@ -913,9 +877,7 @@ def cancel_sync( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_cancel_sync_request( @@ -981,9 +943,7 @@ def trigger_sync( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_trigger_sync_request( @@ -1049,9 +1009,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) request = build_get_request( @@ -1110,16 +1068,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.SyncGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SyncGroup") @@ -1292,9 +1248,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1355,9 +1309,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -1422,9 +1374,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1486,16 +1436,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.SyncGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SyncGroup") @@ -1665,9 +1613,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1735,9 +1681,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncGroupListResult] = kwargs.pop("cls", None) error_map = { 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 863e4d12c80a..b3d54a55612b 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -54,9 +50,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,9 +90,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -140,9 +132,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -177,9 +167,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -221,9 +209,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -262,9 +248,7 @@ def build_list_member_schemas_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -303,9 +287,7 @@ def build_refresh_member_schema_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -387,9 +369,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) request = build_get_request( @@ -450,16 +430,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.SyncMember]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SyncMember") @@ -645,9 +623,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -715,9 +691,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -792,9 +766,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -858,16 +830,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.SyncMember]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SyncMember") @@ -1050,9 +1020,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1123,9 +1091,7 @@ def list_by_sync_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncMemberListResult] = kwargs.pop("cls", None) error_map = { @@ -1221,9 +1187,7 @@ def list_member_schemas( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) error_map = { @@ -1307,9 +1271,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_refresh_member_schema_request( @@ -1384,9 +1346,7 @@ def begin_refresh_member_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) 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 a7a2993c2432..c7d0bbce410c 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -30,10 +30,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,9 +43,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -107,16 +101,14 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "TdeCertificate") @@ -256,9 +248,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py index 920b556640e6..8c41ef4948ed 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,9 +39,7 @@ def build_list_by_location_request(location_name: str, subscription_id: str, **k _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,9 +66,7 @@ def build_get_request(location_name: str, time_zone_id: str, subscription_id: st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,9 +124,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.TimeZoneListResult] = kwargs.pop("cls", None) error_map = { @@ -219,9 +208,7 @@ def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.T _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.TimeZone] = kwargs.pop("cls", None) request = build_get_request( 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 38598e2ca287..ca715acdaff2 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,9 +81,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,9 +119,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -202,9 +192,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.LogicalDatabaseTransparentDataEncryptionListResult] = kwargs.pop("cls", None) error_map = { @@ -303,9 +291,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = kwargs.pop("cls", None) request = build_get_request( @@ -364,16 +350,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.LogicalDatabaseTransparentDataEncryption]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "LogicalDatabaseTransparentDataEncryption") @@ -555,9 +539,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-08-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 93c1b687975c..72d47c5c9742 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_usages_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,9 +46,7 @@ def build_list_by_instance_pool_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,9 +114,7 @@ def list_by_instance_pool( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2021-02-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2021-02-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None) error_map = { 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 6aa231d55278..99815a7443fd 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +42,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,9 +66,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,9 +96,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,9 +126,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -164,9 +152,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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") @@ -200,9 +186,7 @@ def build_update_dns_servers_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -258,9 +242,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.VirtualCluster"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) error_map = { @@ -332,9 +314,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) error_map = { @@ -419,9 +399,7 @@ def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.VirtualCluster] = kwargs.pop("cls", None) request = build_get_request( @@ -472,9 +450,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -531,9 +507,7 @@ def begin_delete(self, resource_group_name: str, virtual_cluster_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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) @@ -591,16 +565,14 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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.VirtualCluster]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "VirtualClusterUpdate") @@ -753,9 +725,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = 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.VirtualCluster] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -814,9 +784,7 @@ def _update_dns_servers_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[Optional[_models.UpdateVirtualClusterDnsServersOperation]] = kwargs.pop("cls", None) request = build_update_dns_servers_request( @@ -884,9 +852,7 @@ def begin_update_dns_servers( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-05-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2022-05-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01-preview")) cls: ClsType[_models.UpdateVirtualClusterDnsServersOperation] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py index f745293ffb54..d7e265143112 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,9 +76,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -118,9 +110,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -147,9 +137,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -222,9 +210,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VirtualNetworkRule] = kwargs.pop("cls", None) request = build_get_request( @@ -281,16 +267,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.VirtualNetworkRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "VirtualNetworkRule") @@ -456,9 +440,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.VirtualNetworkRule] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -518,9 +500,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -582,9 +562,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -644,9 +622,7 @@ def list_by_server( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.VirtualNetworkRuleListResult] = kwargs.pop("cls", None) error_map = { 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 03e700550e22..5a4cdc2e9365 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -54,9 +50,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,9 +90,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -140,9 +132,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -176,9 +166,7 @@ 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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -264,9 +252,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.WorkloadClassifier] = kwargs.pop("cls", None) request = build_get_request( @@ -327,16 +313,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WorkloadClassifier]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "WorkloadClassifier") @@ -528,9 +512,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadClassifier] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -598,9 +580,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -675,9 +655,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -744,9 +722,7 @@ def list_by_workload_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.WorkloadClassifierListResult] = kwargs.pop("cls", None) error_map = { 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 4eb607a99da0..00e58f15de0f 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 @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -31,10 +31,6 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,9 +49,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,9 +87,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -135,9 +127,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) # Construct URL _url = kwargs.pop( "template_url", @@ -165,9 +155,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: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -243,9 +231,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.WorkloadGroup] = kwargs.pop("cls", None) request = build_get_request( @@ -304,16 +290,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.WorkloadGroup]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "WorkloadGroup") @@ -489,9 +473,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -552,9 +534,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -619,9 +599,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -684,9 +662,7 @@ def list_by_database( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-11-01-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-11-01-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) cls: ClsType[_models.WorkloadGroupListResult] = kwargs.pop("cls", None) error_map = { diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py index 20c07d4455c7..a621d70f32d2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.server_azure_ad_administrators.begin_delete( + client.server_azure_ad_administrators.begin_delete( resource_group_name="sqlcrudtest-4799", server_name="sqlcrudtest-6440", administrator_name="ActiveDirectory", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_delete.py index 76a4c845ea88..4635510ce3ad 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.server_azure_ad_only_authentications.begin_delete( + 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 diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py index c4b92f07ce5c..cddf721799ac 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.database_operations.cancel( + client.database_operations.cancel( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-6661", database_name="testdb", operation_id="f779414b-e748-4925-8cfe-c8598f7660ae", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CancelDatabaseOperation.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py index 86d93b9c65ee..8b9a14cab7d6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.elastic_pool_operations.cancel( + client.elastic_pool_operations.cancel( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-6661", elastic_pool_name="testpool", operation_id="f779414b-e748-4925-8cfe-c8598f7660ae", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelElasticPoolOperation.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py index 26e74b0f2893..2e16d38fd68f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.job_executions.cancel( + client.job_executions.cancel( resource_group_name="group1", server_name="server1", job_agent_name="agent1", job_name="job1", job_execution_id="5A86BF65-43AC-F258-2524-9E92992F97CA", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelJobExecution.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py index 54cf628ff8b4..743edb55812e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_instance_operations.cancel( + client.managed_instance_operations.cancel( resource_group_name="sqlcrudtest-7398", managed_instance_name="sqlcrudtest-4645", operation_id="11111111-1111-1111-1111-111111111111", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelManagedInstanceOperation.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py index 1e6905b0c786..e0a8b816c29e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.sensitivity_labels.delete( + client.sensitivity_labels.delete( resource_group_name="myRG", server_name="myServer", database_name="myDatabase", @@ -37,7 +37,6 @@ def main(): table_name="myTable", column_name="myColumn", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py index 336f934359c1..4dfafe61ffab 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.maintenance_windows.create_or_update( + client.maintenance_windows.create_or_update( resource_group_name="Default-SQL-SouthEastAsia", server_name="testsvr", database_name="testdwdb", @@ -38,7 +38,6 @@ def main(): "properties": {"timeRanges": [{"dayOfWeek": "Saturday", "duration": "PT60M", "startTime": "00:00:00"}]} }, ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateMaintenanceWindows.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revalidate.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revalidate.py index 017f35059eb0..951569248ddd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revalidate.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revalidate.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.database_encryption_protectors.begin_revalidate( + client.database_encryption_protectors.begin_revalidate( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-4645", database_name="sqlcrudtestdb-2342", encryption_protector_name="current", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/DatabaseEncryptionProtectorRevalidate.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revert.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revert.py index e86cceca6f5d..04a2e9842e78 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revert.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revert.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.database_encryption_protectors.begin_revert( + client.database_encryption_protectors.begin_revert( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-4645", database_name="sqlcrudtestdb-2342", encryption_protector_name="current", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/DatabaseEncryptionProtectorRevert.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py index 8dee415547a2..b9f62a2b7a15 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.restore_points.delete( + client.restore_points.delete( resource_group_name="Default-SQL-SouthEastAsia", server_name="testserver", database_name="testDatabase", restore_point_name="131546477590000000", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py index 816812ab3109..800e98a40c86 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineAdd.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineAdd.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py index 288766e2d07d..b6ff574a09f7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineAddLatest.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineAddLatest.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.py index f7f59f2fd0f9..1031924a1e1f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py index eb0331c24327..4292826eea36 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py index 37dfcc560683..803bdd76c1e2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py index e8dc23f334e7..80a51b6d5c4c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py index 21b6ca02ccc5..49c31971522a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentListScansResults.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentListScansResults.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py index 37a60c75f9c9..20005cd98146 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-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 index 2258d6821930..dfc15137921a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_delete.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.database_sql_vulnerability_assessment_rule_baselines.delete( + client.database_sql_vulnerability_assessment_rule_baselines.delete( resource_group_name="vulnerabilityaseessmenttest-4711", server_name="vulnerabilityaseessmenttest-6411", database_name="testdb", @@ -37,9 +37,8 @@ def main(): 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 +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py index bfbc378838fa..891a5a484824 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.py index 89bf3f72618d..f4438389a701 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineListByBaseline.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineListByBaseline.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py index 45fcf2070d00..bbed9f52544c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScan.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScan.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.py index c17ce4e94c7a..daba614b2056 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScanRecordsListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-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 index 1ccd2f4803dc..c218fda950ba 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_execute.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_execute.py @@ -29,15 +29,14 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.database_sql_vulnerability_assessment_execute_scan.begin_execute( + 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 +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScansExecute.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py index 13a4fdc9949f..2a31c0d713d5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScansResults.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScansResults.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py index 4ac95e8e8dec..c3d20b02dc4a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.database_vulnerability_assessments.delete( + client.database_vulnerability_assessments.delete( resource_group_name="vulnerabilityaseessmenttest-4799", server_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/DatabaseVulnerabilityAssessmentDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py index b1c764149d26..2490a6445142 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.database_vulnerability_assessment_rule_baselines.delete( + client.database_vulnerability_assessment_rule_baselines.delete( resource_group_name="vulnerabilityaseessmenttest-4799", server_name="vulnerabilityaseessmenttest-6440", database_name="testdb", @@ -37,7 +37,6 @@ def main(): rule_id="VA1001", baseline_name="default", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py index e67ddb60d072..2117b7b47a8e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.database_vulnerability_assessment_scans.begin_initiate_scan( + client.database_vulnerability_assessment_scans.begin_initiate_scan( resource_group_name="vulnerabilityassessmenttest-4711", server_name="vulnerabilityassessmenttest-6411", database_name="testdb", vulnerability_assessment_name="default", scan_id="scan01", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScansExecute.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py index c45d354710cf..4864b772c0d8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.databases.begin_delete( + client.databases.begin_delete( resource_group_name="Default-SQL-SouthEastAsia", server_name="testsvr", database_name="testdb", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/DeleteDatabase.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py index ae1fe71503a5..f0937df86af9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py @@ -29,11 +29,10 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.instance_pools.begin_delete( + client.instance_pools.begin_delete( resource_group_name="group1", instance_pool_name="testIP", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteInstancePool.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py index e674d63eae37..03e616bc0d70 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.jobs.delete( + client.jobs.delete( resource_group_name="group1", server_name="server1", job_agent_name="agent1", job_name="job1", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJob.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py index 1910de35326f..9c054dcfd4ac 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.job_agents.begin_delete( + client.job_agents.begin_delete( resource_group_name="group1", server_name="server1", job_agent_name="agent1", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobAgent.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py index 37449770b808..b323eeea3619 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.job_credentials.delete( + client.job_credentials.delete( resource_group_name="group1", server_name="server1", job_agent_name="agent1", credential_name="cred1", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobCredential.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py index 56053116c258..9f86d1634661 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.job_steps.delete( + client.job_steps.delete( resource_group_name="group1", server_name="server1", job_agent_name="agent1", job_name="job1", step_name="step1", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobStep.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py index dde433114f55..3f15996428e1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.job_target_groups.delete( + client.job_target_groups.delete( resource_group_name="group1", server_name="server1", job_agent_name="agent1", target_group_name="targetGroup1", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobTargetGroup.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py index 0bd4c3f8ea38..cad396212418 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.workload_classifiers.begin_delete( + client.workload_classifiers.begin_delete( resource_group_name="Default-SQL-SouthEastAsia", server_name="testsvr", database_name="testdb", workload_group_name="wlm_workloadgroup", workload_classifier_name="wlm_workloadclassifier", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadClassifier.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py index fcd45ca4b5dd..e035505b4552 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.workload_groups.begin_delete( + client.workload_groups.begin_delete( resource_group_name="Default-SQL-SouthEastAsia", server_name="testsvr", database_name="testdb", workload_group_name="wlm_workloadgroup", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadGroup.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_delete.py index aef8a014a7c4..de7fdbff8e77 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="f2669dff-5f08-45dd-b857-b2a60b72cdc9", ) - response = client.distributed_availability_groups.begin_delete( + client.distributed_availability_groups.begin_delete( resource_group_name="testrg", managed_instance_name="testcl", distributed_availability_group_name="dag", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py index b6b111ab5651..d0105bd22aea 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.elastic_pools.begin_delete( + client.elastic_pools.begin_delete( resource_group_name="sqlcrudtest-3129", server_name="sqlcrudtest-228", elastic_pool_name="sqlcrudtest-3851", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_list_with_filter.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_list_with_filter.py deleted file mode 100644 index dfb5613f3f66..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_list_with_filter.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -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/encryption_protector_revalidate.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.py index 467457b3bd41..55768755af09 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.encryption_protectors.begin_revalidate( + client.encryption_protectors.begin_revalidate( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-4645", encryption_protector_name="current", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorRevalidate.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py index ce0336dfb4fb..4c46cb92bfb6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.databases.begin_failover( + client.databases.begin_failover( resource_group_name="group1", server_name="testServer", database_name="testDatabase", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/FailoverDatabase.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py index 462bd6bc8393..2f6fc99c977d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.elastic_pools.begin_failover( + client.elastic_pools.begin_failover( resource_group_name="group1", server_name="testServer", elastic_pool_name="testElasticPool", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/FailoverElasticPool.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update.py index 7361035822f1..beb7daf53701 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_create_or_update.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupCreateOrUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_delete.py index 752e6920c641..a9b7cf679926 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.failover_groups.begin_delete( + client.failover_groups.begin_delete( resource_group_name="Default", server_name="failover-group-primary-server", 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/FailoverGroupDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_failover.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_failover.py index ef197914664c..88f7dace7e9c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_failover.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_failover.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupFailover.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupFailover.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_force_failover_allow_data_loss.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_force_failover_allow_data_loss.py index f3cdaf43be42..24df960d05af 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_force_failover_allow_data_loss.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_force_failover_allow_data_loss.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupForceFailoverAllowDataLoss.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupForceFailoverAllowDataLoss.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_get.py index a128a58374a6..63dc7ca29d5e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_list.py index 8d53d19722dd..1b0c38a52ff7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_list_with_filter.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_try_planned_before_forced_failover.py similarity index 72% rename from sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_list_with_filter.py rename to sdk/sql/azure-mgmt-sql/generated_samples/failover_group_try_planned_before_forced_failover.py index 520bc953da70..aca6172fdbfb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_list_with_filter.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_try_planned_before_forced_failover.py @@ -14,7 +14,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python database_metrics_list_with_filter.py + python failover_group_try_planned_before_forced_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, @@ -29,16 +29,14 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.databases.list_metrics( - resource_group_name="sqlcrudtest-6730", - server_name="sqlcrudtest-9007", - database_name="3481", - filter="name/value eq 'cpu_percent' and timeGrain eq '00:10:00' and startTime eq '2017-06-02T18:35:00Z' and endTime eq '2017-06-02T18:55:00Z'", - ) - for item in response: - print(item) + response = client.failover_groups.begin_try_planned_before_forced_failover( + resource_group_name="Default", + server_name="failovergroupsecondaryserver", + failover_group_name="failovergrouptest3", + ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsListWithFilter.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupTryPlannedBeforeForcedFailover.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update.py index aab88e20be6d..3fb293c37412 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/FailoverGroupUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_managed_instance.py index 1a94151fa33f..24f8b6559c88 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_managed_instance.py @@ -29,11 +29,10 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_instances.begin_failover( + client.managed_instances.begin_failover( resource_group_name="group1", managed_instance_name="instanceName", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/FailoverManagedInstance.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py index 0e1e24370a3f..2e0f59421969 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.firewall_rules.delete( + client.firewall_rules.delete( resource_group_name="firewallrulecrudtest-9886", server_name="firewallrulecrudtest-2368", firewall_rule_name="firewallrulecrudtest-7011", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions.py index 3220104022b0..2cd7ea4ba561 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 @@ -29,13 +29,12 @@ def main(): subscription_id="a3473687-7581-41e1-ac24-6bcca5843f07", ) - response = client.database_extensions.get( + client.database_extensions.get( resource_group_name="rg_a1f9d6f8-30d5-4228-9504-8a364361bca3", server_name="srv_65858e0f-b1d1-4bdc-8351-a7da86ca4939", database_name="11aa6c5e-58ed-4693-b303-3b8e3131deaa", extension_name="polybaseimport", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseExtensions.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_delete.py index d6151c956726..c0a23c9d8722 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.instance_failover_groups.begin_delete( + 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/2022-05-01-preview/examples/InstanceFailoverGroupDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py index 0f1d5fa77024..486d0b050f25 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py index fdee6ffb6a56..fa15bfeeba47 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.ipv6_firewall_rules.delete( + client.ipv6_firewall_rules.delete( resource_group_name="firewallrulecrudtest-9886", server_name="firewallrulecrudtest-2368", firewall_rule_name="firewallrulecrudtest-7011", ) - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py index ccff9a831532..3e718510eeb1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py index fc6d5c05bb4f..0933084bd451 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py index 618a8bbe01b5..87ce443a489e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py index d9ff78a5b66f..bf884e947bc4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.long_term_retention_backups.begin_delete( + client.long_term_retention_backups.begin_delete( 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/LongTermRetentionBackupDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py index 37e5ddb7ea17..0b62cb511e94 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_databases.begin_cancel_move( + client.managed_databases.begin_cancel_move( resource_group_name="group1", managed_instance_name="testInstanceSrc", database_name="testDatabase", @@ -37,7 +37,6 @@ def main(): "destinationManagedDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase" }, ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCancelMove.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py index be580835629b..91d48d4537b0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_database_sensitivity_labels.delete( + client.managed_database_sensitivity_labels.delete( resource_group_name="myRG", managed_instance_name="myManagedInstanceName", database_name="myDatabase", @@ -37,7 +37,6 @@ def main(): table_name="myTable", column_name="myColumn", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py index e3aec68d5378..3e70339b1581 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_databases.begin_complete_restore( + client.managed_databases.begin_complete_restore( resource_group_name="myRG", managed_instance_name="myManagedInstanceName", database_name="myDatabase", parameters={"lastBackupName": "testdb1_log4"}, ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCompleteExternalRestore.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py index 3bf39375b120..7a53e735cdad 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_databases.begin_complete_move( + client.managed_databases.begin_complete_move( resource_group_name="group1", managed_instance_name="testInstanceSrc", database_name="testDatabase", @@ -37,7 +37,6 @@ def main(): "destinationManagedDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase" }, ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCompleteMove.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py index f02a32218b69..bb7043b7f774 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_databases.begin_delete( + client.managed_databases.begin_delete( resource_group_name="Default-SQL-SouthEastAsia", managed_instance_name="managedInstance", database_name="testdb", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py index 7e0eddb653d8..3e01ebe24ba8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_database_sensitivity_labels.disable_recommendation( + client.managed_database_sensitivity_labels.disable_recommendation( resource_group_name="myRG", managed_instance_name="myManagedInstanceName", database_name="myDatabase", @@ -37,7 +37,6 @@ def main(): table_name="myTable", column_name="myColumn", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelDisable.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py index 91f9169d6347..214b79276cdd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_database_sensitivity_labels.enable_recommendation( + client.managed_database_sensitivity_labels.enable_recommendation( resource_group_name="myRG", managed_instance_name="myManagedInstanceName", database_name="myDatabase", @@ -37,7 +37,6 @@ def main(): table_name="myTable", column_name="myColumn", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelEnable.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py index aaf5fd7876fb..9ef9bcd8c889 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_database_sensitivity_labels.update( + client.managed_database_sensitivity_labels.update( resource_group_name="myRG", managed_instance_name="myManagedInstanceName", database_name="myDatabase", @@ -71,7 +71,6 @@ def main(): ] }, ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsCurrentUpdate.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py index 5d298ccdca88..bead3b75387d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_database_recommended_sensitivity_labels.update( + client.managed_database_recommended_sensitivity_labels.update( resource_group_name="myRG", managed_instance_name="myManagedInstanceName", database_name="myDatabase", @@ -41,7 +41,6 @@ def main(): ] }, ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsRecommendedUpdate.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py index 4fc316af17f8..532217d2c765 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_databases.begin_start_move( + client.managed_databases.begin_start_move( resource_group_name="group1", managed_instance_name="testInstanceSrc", database_name="testDatabase", @@ -38,7 +38,6 @@ def main(): "operationMode": "Copy", }, ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseStartMoveMax.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py index 4aae88382c6b..6c1c10811473 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_databases.begin_start_move( + client.managed_databases.begin_start_move( resource_group_name="group1", managed_instance_name="testInstanceSrc", database_name="testDatabase", @@ -37,7 +37,6 @@ def main(): "destinationManagedDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase" }, ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseStartMoveMin.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.py index 33be4404e456..a572275a8634 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_database_vulnerability_assessments.delete( + 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 diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.py index 075cb14470b5..2f7ac6a846d6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_database_vulnerability_assessment_rule_baselines.delete( + client.managed_database_vulnerability_assessment_rule_baselines.delete( resource_group_name="vulnerabilityaseessmenttest-4799", managed_instance_name="vulnerabilityaseessmenttest-6440", database_name="testdb", @@ -37,7 +37,6 @@ def main(): 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 diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.py index cc2ccb0a1147..30972ff47d86 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_database_vulnerability_assessment_scans.begin_initiate_scan( + 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 diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py index 48581ce4a599..163509cfe48e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_instance_administrators.begin_delete( + client.managed_instance_administrators.begin_delete( resource_group_name="Default-SQL-SouthEastAsia", managed_instance_name="managedInstance", administrator_name="ActiveDirectory", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py index c9a4656700be..57c1f32d167f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_instance_azure_ad_only_authentications.begin_delete( + client.managed_instance_azure_ad_only_authentications.begin_delete( resource_group_name="Default-SQL-SouthEastAsia", managed_instance_name="managedInstance", authentication_name="Default", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_delete.py index 29c89ef643ab..787896b7107c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_delete.py @@ -29,11 +29,10 @@ def main(): subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", ) - response = client.managed_instances.begin_delete( + client.managed_instances.begin_delete( resource_group_name="testrg", managed_instance_name="testinstance", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedInstanceDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.py index 58ac0bfe8a91..eb5d1fb29de7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_instance_encryption_protectors.begin_revalidate( + 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 diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py index 00212ac55852..26b986e3661d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_instance_keys.begin_delete( + client.managed_instance_keys.begin_delete( resource_group_name="sqlcrudtest-7398", managed_instance_name="sqlcrudtest-4645", key_name="someVault_someKey_01234567890123456789012345678901", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.py index 31f8f5e4e66c..09f172c4b454 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.long_term_retention_managed_instance_backups.begin_delete( + 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 diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py index f2b69934688e..bc8d54c50a37 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_instance_private_endpoint_connections.begin_delete( + client.managed_instance_private_endpoint_connections.begin_delete( resource_group_name="Default", managed_instance_name="test-cl", 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/ManagedInstancePrivateEndpointConnectionDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py index 33f0d11ae0c4..7ea6907d4e4e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000001", ) - response = client.managed_instance_tde_certificates.begin_create( + client.managed_instance_tde_certificates.begin_create( resource_group_name="testtdecert", managed_instance_name="testtdecert", parameters={"properties": {"privateBlob": "MIIXXXXXXXX"}}, ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTdeCertificate.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py index 0bd29afdeec7..f18004c7b67d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_instance_vulnerability_assessments.delete( + client.managed_instance_vulnerability_assessments.delete( resource_group_name="vulnerabilityaseessmenttest-4799", managed_instance_name="vulnerabilityaseessmenttest-6440", vulnerability_assessment_name="default", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py index 67151e54722c..ae7f88b8cbf2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_server_dns_aliases.begin_delete( + client.managed_server_dns_aliases.begin_delete( resource_group_name="Default", managed_instance_name="dns-mi", dns_alias_name="dns-alias-mi", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py index 580f103275a5..5d7873106afe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.outbound_firewall_rules.begin_delete( + client.outbound_firewall_rules.begin_delete( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-6661", outbound_rule_fqdn="server.database.windows.net", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_delete.py index 3917f9646351..f312565abce9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.private_endpoint_connections.begin_delete( + 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 diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py index c2b07f780886..729f31635410 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.sensitivity_labels.disable_recommendation( + client.sensitivity_labels.disable_recommendation( resource_group_name="myRG", server_name="myServer", database_name="myDatabase", @@ -37,7 +37,6 @@ def main(): table_name="myTable", column_name="myColumn", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelDisable.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py index d59975a15795..4f87fa613e12 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.sensitivity_labels.enable_recommendation( + client.sensitivity_labels.enable_recommendation( resource_group_name="myRG", server_name="myServer", database_name="myDatabase", @@ -37,7 +37,6 @@ def main(): table_name="myTable", column_name="myColumn", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelEnable.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py index 536e4550d297..60ba9ac68746 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.databases.rename( + client.databases.rename( resource_group_name="Default-SQL-SouthEastAsia", server_name="testsvr", database_name="testdb", @@ -37,7 +37,6 @@ def main(): "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/newtestdb" }, ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/RenameDatabase.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_delete.py index e1f10e6072dc..8d8f4adfefb5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.replication_links.begin_delete( + client.replication_links.begin_delete( resource_group_name="Default", server_name="sourcesvr", database_name="gamma-db", link_id="4891ca10-ebd0-47d7-9182-c722651780fb", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ReplicationLinkDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.py index 983e2e17ee62..c09ce56b1260 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.long_term_retention_backups.begin_delete_by_resource_group( + 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 diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.py index 2eb361811a3b..d82e69790ab4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.long_term_retention_managed_instance_backups.begin_delete_by_resource_group( + 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 diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py index b92df352c987..74180f788f2c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.sensitivity_labels.update( + client.sensitivity_labels.update( resource_group_name="myRG", server_name="myServer", database_name="myDatabase", @@ -73,7 +73,6 @@ def main(): ] }, ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsCurrentUpdate.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py index 87f9c2344418..cf067f8df378 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py @@ -29,7 +29,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.recommended_sensitivity_labels.update( + client.recommended_sensitivity_labels.update( resource_group_name="myRG", server_name="myServer", database_name="myDatabase", @@ -41,7 +41,6 @@ def main(): ] }, ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsRecommendedUpdate.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_delete.py index 97cc14bf612d..072fa1091a30 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.server_communication_links.delete( + client.server_communication_links.delete( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-4645", communication_link_name="link1", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py index 1d89eaca3b5e..31c147f52a0f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py @@ -29,11 +29,10 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.servers.begin_delete( + client.servers.begin_delete( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-6661", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py index 80a6c94a1304..262eec2beff0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.server_dns_aliases.begin_delete( + client.server_dns_aliases.begin_delete( resource_group_name="Default", server_name="dns-alias-server", dns_alias_name="dns-alias-name-1", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py index 977824130c2f..cfb1f4088b10 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.server_keys.begin_delete( + client.server_keys.begin_delete( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-4645", key_name="someVault_someKey_01234567890123456789012345678901", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py index d059cbfd7b90..b3c7fdfdc15c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="38e0dc56-907f-45ba-a97c-74233baad471", ) - response = client.server_trust_certificates.begin_delete( + client.server_trust_certificates.begin_delete( resource_group_name="testrg", managed_instance_name="testcl", certificate_name="customerCertificateName", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py index b2eb24b0d89f..68d80d3c7741 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.server_trust_groups.begin_delete( + client.server_trust_groups.begin_delete( resource_group_name="Default", location_name="Japan East", server_trust_group_name="server-trust-group-test", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py index 4d87229ce241..d88fd2a45c2f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.server_vulnerability_assessments.delete( + client.server_vulnerability_assessments.delete( resource_group_name="vulnerabilityaseessmenttest-4799", server_name="vulnerabilityaseessmenttest-6440", vulnerability_assessment_name="default", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.py index 84bb76a24f7d..cca97efabaed 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-0000-0000-0000-000000000001", ) - response = client.tde_certificates.begin_create( + 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 diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py index 4e12146256ee..1b40027b4000 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentBaselineAdd.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-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 index 121d0d9b0910..91daf8b04098 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add_latest.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add_latest.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentBaselineAddLatest.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-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 index 0a6daeed89bc..1c4b963bd9b3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentBaselineGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-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 index 86b8fd3b0354..ca50851d9f16 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py index d92aae9d3057..3817ee4d851f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py index 50c8d5808f55..5460cac474fb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.sql_vulnerability_assessments.delete( + client.sql_vulnerability_assessments.delete( resource_group_name="vulnerabilityaseessmenttest-4799", server_name="vulnerabilityaseessmenttest-6440", vulnerability_assessment_name="default", ) - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py index 0cd52a7cf2ea..6b69c0e0be55 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py index 983fffd74868..f7b31184bac3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentListByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py index dfaab96dedd3..e719887e2d53 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentListScansResults.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentListScansResults.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py index c6963c7a22ac..ca3c4951252d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-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 index d6ff3d83d2f8..62d39d1289ea 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_delete.py @@ -29,16 +29,15 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.sql_vulnerability_assessment_rule_baselines.delete( + 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 +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-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 index 9dbf4a7dec6f..f8d06bf1a1cf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py index 558be462ae90..cfc4c9a39559 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineListByBaseline.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineListByBaseline.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py index 3bd9a1fb0e3d..3b2fb927653a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentScan.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentScan.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.py index 0bd2dded3e32..03465a9fd1c4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentScanRecordsListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-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 index 497f26ca0dbf..ab1a2024ee19 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_execute.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_execute.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.sql_vulnerability_assessment_execute_scan.begin_execute( + 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 +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentScansExecute.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py index a5018b9028ad..81bde1e99009 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/SqlVulnerabilityAssessmentScansResults.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentScansResults.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/start_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/start_managed_instance.py index 1d60eb1bc6e3..be359faf7a5d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/start_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/start_managed_instance.py @@ -29,11 +29,10 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_instances.begin_start( + client.managed_instances.begin_start( resource_group_name="startrg", managed_instance_name="mitostart", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartManagedInstance.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_delete.py index 0e549544924f..c27f17e28a32 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.start_stop_managed_instance_schedules.delete( + client.start_stop_managed_instance_schedules.delete( resource_group_name="schedulerg", managed_instance_name="schedulemi", start_stop_schedule_name="default", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartStopManagedInstanceScheduleDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/stop_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/stop_managed_instance.py index 0179cee60d51..9da57e70505a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/stop_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/stop_managed_instance.py @@ -29,11 +29,10 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.managed_instances.begin_stop( + client.managed_instances.begin_stop( resource_group_name="stoprg", managed_instance_name="mitostop", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StopManagedInstance.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py index b6560bb782e8..48d0aa6e3f29 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.sync_agents.begin_delete( + client.sync_agents.begin_delete( resource_group_name="syncagentcrud-65440", server_name="syncagentcrud-8475", sync_agent_name="syncagentcrud-3187", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py index 44dd66dbd5b4..a01d50f40338 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.sync_groups.cancel_sync( + client.sync_groups.cancel_sync( resource_group_name="syncgroupcrud-65440", server_name="syncgroupcrud-8475", database_name="syncgroupcrud-4328", sync_group_name="syncgroupcrud-3187", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCancelSync.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py index 233e9e7f5ff7..3697e093e721 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.sync_groups.begin_delete( + client.sync_groups.begin_delete( resource_group_name="syncgroupcrud-65440", server_name="syncgroupcrud-8475", database_name="syncgroupcrud-4328", sync_group_name="syncgroupcrud-3187", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py index dab504e2f495..5def80c744c0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.sync_groups.begin_refresh_hub_schema( + client.sync_groups.begin_refresh_hub_schema( resource_group_name="syncgroupcrud-65440", server_name="syncgroupcrud-8475", database_name="syncgroupcrud-4328", sync_group_name="syncgroupcrud-3187", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupRefreshHubSchema.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py index 820f76ceb692..9d7f5f0fa7f7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py @@ -29,13 +29,12 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.sync_groups.trigger_sync( + client.sync_groups.trigger_sync( resource_group_name="syncgroupcrud-65440", server_name="syncgroupcrud-8475", database_name="syncgroupcrud-4328", sync_group_name="syncgroupcrud-3187", ) - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupTriggerSync.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py index e1ffaed7d98e..446300384fc3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.sync_members.begin_delete( + client.sync_members.begin_delete( resource_group_name="syncgroupcrud-65440", server_name="syncgroupcrud-8475", database_name="syncgroupcrud-4328", sync_group_name="syncgroupcrud-3187", sync_member_name="syncgroupcrud-4879", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py index 783965eb2ec8..17c9e1a4b6dd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py @@ -29,14 +29,13 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.sync_members.begin_refresh_member_schema( + client.sync_members.begin_refresh_member_schema( resource_group_name="syncgroupcrud-65440", server_name="syncgroupcrud-8475", database_name="syncgroupcrud-4328", sync_group_name="syncgroupcrud-3187", sync_member_name="syncgroupcrud-4879", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberRefreshSchema.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py b/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py index 3329756d0281..823fc34d090a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.databases.begin_upgrade_data_warehouse( + client.databases.begin_upgrade_data_warehouse( resource_group_name="Default-SQL-SouthEastAsia", server_name="testsvr", database_name="testdwdb", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/UpgradeDataWarehouse.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py index 2d3d33c79358..d596b95fe655 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py @@ -29,11 +29,10 @@ def main(): subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", ) - response = client.virtual_clusters.begin_delete( + client.virtual_clusters.begin_delete( resource_group_name="testrg", virtual_cluster_name="vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterDelete.json diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py index 09063092517b..be6cdf51fe8b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.virtual_network_rules.begin_delete( + client.virtual_network_rules.begin_delete( resource_group_name="Default", server_name="vnet-test-svr", virtual_network_rule_name="vnet-firewall-rule", ).result() - print(response) # x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesDelete.json diff --git a/sdk/sql/azure-mgmt-sql/setup.py b/sdk/sql/azure-mgmt-sql/setup.py index fd55f16de0b5..160c7d57654e 100644 --- a/sdk/sql/azure-mgmt-sql/setup.py +++ b/sdk/sql/azure-mgmt-sql/setup.py @@ -1,10 +1,10 @@ #!/usr/bin/env python -#------------------------------------------------------------------------- +# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. -#-------------------------------------------------------------------------- +# -------------------------------------------------------------------------- import re import os.path @@ -16,58 +16,62 @@ PACKAGE_PPRINT_NAME = "SQL Management" # a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace('-', '/') +package_folder_path = PACKAGE_NAME.replace("-", "/") # a-b-c => a.b.c -namespace_name = PACKAGE_NAME.replace('-', '.') +namespace_name = PACKAGE_NAME.replace("-", ".") # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py') - if os.path.exists(os.path.join(package_folder_path, 'version.py')) - else os.path.join(package_folder_path, '_version.py'), 'r') as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', - fd.read(), re.MULTILINE).group(1) +with open( + os.path.join(package_folder_path, "version.py") + if os.path.exists(os.path.join(package_folder_path, "version.py")) + else os.path.join(package_folder_path, "_version.py"), + "r", +) as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) if not version: - raise RuntimeError('Cannot find version information') + raise RuntimeError("Cannot find version information") -with open('README.md', encoding='utf-8') as f: +with open("README.md", encoding="utf-8") as f: readme = f.read() -with open('CHANGELOG.md', encoding='utf-8') as f: +with open("CHANGELOG.md", encoding="utf-8") as f: changelog = f.read() setup( name=PACKAGE_NAME, version=version, - description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), - long_description=readme + '\n\n' + changelog, - long_description_content_type='text/markdown', - license='MIT License', - author='Microsoft Corporation', - author_email='azpysdkhelp@microsoft.com', - url='https://github.com/Azure/azure-sdk-for-python', + description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME), + long_description=readme + "\n\n" + changelog, + long_description_content_type="text/markdown", + license="MIT License", + author="Microsoft Corporation", + author_email="azpysdkhelp@microsoft.com", + url="https://github.com/Azure/azure-sdk-for-python", keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product classifiers=[ - 'Development Status :: 4 - Beta', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'License :: OSI Approved :: MIT License', + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "License :: OSI Approved :: MIT License", ], zip_safe=False, - packages=find_packages(exclude=[ - 'tests', - # Exclude packages that will be covered by PEP420 or nspkg - 'azure', - 'azure.mgmt', - ]), + packages=find_packages( + exclude=[ + "tests", + # Exclude packages that will be covered by PEP420 or nspkg + "azure", + "azure.mgmt", + ] + ), include_package_data=True, package_data={ - 'pytyped': ['py.typed'], + "pytyped": ["py.typed"], }, install_requires=[ "isodate<1.0.0,>=0.6.1", @@ -75,5 +79,5 @@ "azure-mgmt-core>=1.3.2,<2.0.0", "typing-extensions>=4.3.0; python_version<'3.8.0'", ], - python_requires=">=3.7" + python_requires=">=3.7", ) diff --git a/sdk/sql/azure-mgmt-sql/tests/recordings/test_cli_mgmt_sql_managed_instance.pyTestMgmtSqltest_instance_operation.json b/sdk/sql/azure-mgmt-sql/tests/recordings/test_cli_mgmt_sql_managed_instance.pyTestMgmtSqltest_instance_operation.json index e2cea4f751b6..621cacf3301e 100644 --- a/sdk/sql/azure-mgmt-sql/tests/recordings/test_cli_mgmt_sql_managed_instance.pyTestMgmtSqltest_instance_operation.json +++ b/sdk/sql/azure-mgmt-sql/tests/recordings/test_cli_mgmt_sql_managed_instance.pyTestMgmtSqltest_instance_operation.json @@ -7,7 +7,7 @@ "Accept": "*/*", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", - "User-Agent": "azsdk-python-identity/1.13.0b4 Python/3.8.16 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0" + "User-Agent": "azsdk-python-identity/1.14.0b2 Python/3.8.17 (Linux-5.15.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0" }, "RequestBody": null, "StatusCode": 200, @@ -17,12 +17,12 @@ "Cache-Control": "max-age=86400, private", "Content-Length": "1753", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 28 Mar 2023 06:20:12 GMT", + "Date": "Tue, 27 Jun 2023 06:36:13 GMT", "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", "Set-Cookie": "[set-cookie;]", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-ests-server": "2.1.14990.5 - WUS2 ProdSlices", + "x-ms-ests-server": "2.1.15723.3 - SCUS ProdSlices", "X-XSS-Protection": "0" }, "ResponseBody": { @@ -101,7 +101,7 @@ "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", "Cookie": "cookie;", - "User-Agent": "azsdk-python-identity/1.13.0b4 Python/3.8.16 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0" + "User-Agent": "azsdk-python-identity/1.14.0b2 Python/3.8.17 (Linux-5.15.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0" }, "RequestBody": null, "StatusCode": 200, @@ -111,12 +111,12 @@ "Cache-Control": "max-age=86400, private", "Content-Length": "945", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 28 Mar 2023 06:20:12 GMT", + "Date": "Tue, 27 Jun 2023 06:36:14 GMT", "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", "Set-Cookie": "[set-cookie;]", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-ests-server": "2.1.14939.4 - EUS ProdSlices", + "x-ms-ests-server": "2.1.15723.3 - EUS ProdSlices", "X-XSS-Protection": "0" }, "ResponseBody": { @@ -172,28 +172,28 @@ "RequestHeaders": { "Accept": "application/json", "Accept-Encoding": "gzip, deflate", - "client-request-id": "ab846ac0-bfdf-4448-9b2f-540132c41a57", + "client-request-id": "47d733b4-5044-40c0-bdb8-bf17f742ee6c", "Connection": "keep-alive", "Content-Length": "288", "Content-Type": "application/x-www-form-urlencoded", "Cookie": "cookie;", - "User-Agent": "azsdk-python-identity/1.13.0b4 Python/3.8.16 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0", + "User-Agent": "azsdk-python-identity/1.14.0b2 Python/3.8.17 (Linux-5.15.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0", "x-client-cpu": "x64", "x-client-current-telemetry": "4|730,0|", "x-client-last-telemetry": "4|0|||", "x-client-os": "linux", "x-client-sku": "MSAL.Python", - "x-client-ver": "1.21.0", + "x-client-ver": "1.22.0", "x-ms-lib-capability": "retry-after, h429" }, "RequestBody": "client_id=00000000-0000-0000-0000-000000000000\u0026grant_type=client_credentials\u0026client_info=1\u0026client_secret=00000000-0000-0000-0000-000000000000\u0026claims=%7B%22access_token%22%3A\u002B%7B%22xms_cc%22%3A\u002B%7B%22values%22%3A\u002B%5B%22CP1%22%5D%7D%7D%7D\u0026scope=https%3A%2F%2Fmanagement.azure.com%2F.default", "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-store, no-cache", - "client-request-id": "ab846ac0-bfdf-4448-9b2f-540132c41a57", + "client-request-id": "47d733b4-5044-40c0-bdb8-bf17f742ee6c", "Content-Length": "114", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 28 Mar 2023 06:20:12 GMT", + "Date": "Tue, 27 Jun 2023 06:36:14 GMT", "Expires": "-1", "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", "Pragma": "no-cache", @@ -201,7 +201,7 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-clitelem": "1,0,0,,", - "x-ms-ests-server": "2.1.14990.5 - SCUS ProdSlices", + "x-ms-ests-server": "2.1.15723.3 - NCUS ProdSlices", "X-XSS-Protection": "0" }, "ResponseBody": { @@ -219,7 +219,7 @@ "Accept": "application/json", "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", - "User-Agent": "azsdk-python-mgmt-sql/4.0.0b10 Python/3.8.16 (Linux-5.15.0-1034-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0" + "User-Agent": "azsdk-python-mgmt-sql/4.0.0b11 Python/3.8.17 (Linux-5.15.0-1040-azure-x86_64-with-glibc2.2.5) VSTS_0fb41ef4-5012-48a9-bf39-4ee3de03ee35_build_2500_0" }, "RequestBody": null, "StatusCode": 200, @@ -228,15 +228,15 @@ "Content-Encoding": "gzip", "Content-Length": "12", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 28 Mar 2023 06:20:13 GMT", + "Date": "Tue, 27 Jun 2023 06:36:15 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "9f29f43b-586e-4c00-9766-983dfa4fb839", + "x-ms-correlation-request-id": "b22c1dd2-eb8f-40a5-ba5e-164ca13726a3", "x-ms-ratelimit-remaining-subscription-reads": "11999", - "x-ms-routing-request-id": "SOUTHCENTRALUS:20230328T062013Z:9f29f43b-586e-4c00-9766-983dfa4fb839" + "x-ms-routing-request-id": "WESTUS:20230627T063615Z:b22c1dd2-eb8f-40a5-ba5e-164ca13726a3" }, "ResponseBody": { "value": []