From 4a051796df807929225fc1534315843c00500ceb Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 26 Dec 2022 06:45:10 +0000 Subject: [PATCH] CodeGen from PR 21988 in Azure/azure-rest-api-specs Merge 1ae8826ff8e3a12951c84335e302f8a519684453 into 40354d03b1fa91a41eec400a5ed54d4cce457c28 --- sdk/security/azure-mgmt-security/_meta.json | 6 +- .../azure/mgmt/security/_configuration.py | 6 +- .../azure/mgmt/security/_security_center.py | 75 ++- .../azure/mgmt/security/_serialization.py | 603 ++++++++---------- .../azure/mgmt/security/aio/_configuration.py | 2 +- .../mgmt/security/aio/_security_center.py | 71 ++- .../security/v2015_06_01_preview/__init__.py | 2 +- .../v2015_06_01_preview/_configuration.py | 7 +- .../v2015_06_01_preview/_metadata.json | 4 +- .../v2015_06_01_preview/_security_center.py | 13 +- .../security/v2015_06_01_preview/_version.py | 2 +- .../v2015_06_01_preview/aio/__init__.py | 2 +- .../v2015_06_01_preview/aio/_configuration.py | 2 +- .../aio/_security_center.py | 4 +- .../aio/operations/__init__.py | 2 +- .../aio/operations/_locations_operations.py | 28 +- .../aio/operations/_operations.py | 16 +- .../aio/operations/_tasks_operations.py | 108 ++-- .../v2015_06_01_preview/models/__init__.py | 2 +- .../operations/__init__.py | 2 +- .../operations/_locations_operations.py | 40 +- .../operations/_operations.py | 20 +- .../operations/_tasks_operations.py | 150 +++-- .../mgmt/security/v2017_08_01/__init__.py | 2 +- .../security/v2017_08_01/_configuration.py | 7 +- .../mgmt/security/v2017_08_01/_metadata.json | 4 +- .../security/v2017_08_01/_security_center.py | 13 +- .../mgmt/security/v2017_08_01/_version.py | 2 +- .../mgmt/security/v2017_08_01/aio/__init__.py | 2 +- .../v2017_08_01/aio/_configuration.py | 2 +- .../v2017_08_01/aio/_security_center.py | 4 +- .../v2017_08_01/aio/operations/__init__.py | 2 +- .../_compliance_results_operations.py | 24 +- .../security/v2017_08_01/models/__init__.py | 2 +- .../v2017_08_01/operations/__init__.py | 2 +- .../_compliance_results_operations.py | 32 +- .../security/v2017_08_01_preview/__init__.py | 2 +- .../v2017_08_01_preview/_configuration.py | 7 +- .../v2017_08_01_preview/_metadata.json | 4 +- .../v2017_08_01_preview/_security_center.py | 13 +- .../security/v2017_08_01_preview/_version.py | 2 +- .../v2017_08_01_preview/aio/__init__.py | 2 +- .../v2017_08_01_preview/aio/_configuration.py | 2 +- .../aio/_security_center.py | 4 +- .../aio/operations/__init__.py | 2 +- .../_auto_provisioning_settings_operations.py | 46 +- .../aio/operations/_compliances_operations.py | 28 +- ...ormation_protection_policies_operations.py | 50 +- .../_security_contacts_operations.py | 76 ++- .../_workspace_settings_operations.py | 76 ++- .../v2017_08_01_preview/models/__init__.py | 2 +- .../operations/__init__.py | 2 +- .../_auto_provisioning_settings_operations.py | 66 +- .../operations/_compliances_operations.py | 40 +- ...ormation_protection_policies_operations.py | 70 +- .../_security_contacts_operations.py | 110 ++-- .../_workspace_settings_operations.py | 110 ++-- .../mgmt/security/v2018_06_01/__init__.py | 2 +- .../security/v2018_06_01/_configuration.py | 7 +- .../mgmt/security/v2018_06_01/_metadata.json | 4 +- .../security/v2018_06_01/_security_center.py | 13 +- .../mgmt/security/v2018_06_01/_version.py | 2 +- .../mgmt/security/v2018_06_01/aio/__init__.py | 2 +- .../v2018_06_01/aio/_configuration.py | 2 +- .../v2018_06_01/aio/_security_center.py | 4 +- .../v2018_06_01/aio/operations/__init__.py | 2 +- .../aio/operations/_pricings_operations.py | 32 +- .../security/v2018_06_01/models/__init__.py | 2 +- .../v2018_06_01/operations/__init__.py | 2 +- .../operations/_pricings_operations.py | 46 +- .../mgmt/security/v2019_01_01/__init__.py | 2 +- .../security/v2019_01_01/_configuration.py | 7 +- .../mgmt/security/v2019_01_01/_metadata.json | 4 +- .../security/v2019_01_01/_security_center.py | 13 +- .../mgmt/security/v2019_01_01/_version.py | 2 +- .../mgmt/security/v2019_01_01/aio/__init__.py | 2 +- .../v2019_01_01/aio/_configuration.py | 2 +- .../v2019_01_01/aio/_security_center.py | 4 +- .../v2019_01_01/aio/operations/__init__.py | 2 +- .../_advanced_threat_protection_operations.py | 28 +- .../security/v2019_01_01/models/__init__.py | 2 +- .../v2019_01_01/operations/__init__.py | 2 +- .../_advanced_threat_protection_operations.py | 42 +- .../security/v2019_01_01_preview/__init__.py | 2 +- .../v2019_01_01_preview/_configuration.py | 7 +- .../v2019_01_01_preview/_metadata.json | 4 +- .../v2019_01_01_preview/_security_center.py | 13 +- .../security/v2019_01_01_preview/_version.py | 2 +- .../v2019_01_01_preview/aio/__init__.py | 2 +- .../v2019_01_01_preview/aio/_configuration.py | 2 +- .../aio/_security_center.py | 4 +- .../aio/operations/__init__.py | 2 +- .../_alerts_suppression_rules_operations.py | 60 +- .../aio/operations/_automations_operations.py | 98 +-- ...atory_compliance_assessments_operations.py | 32 +- ...gulatory_compliance_controls_operations.py | 32 +- ...ulatory_compliance_standards_operations.py | 32 +- .../operations/_sub_assessments_operations.py | 46 +- .../v2019_01_01_preview/models/__init__.py | 2 +- .../v2019_01_01_preview/models/_models_py3.py | 24 +- .../operations/__init__.py | 2 +- .../_alerts_suppression_rules_operations.py | 86 +-- .../operations/_automations_operations.py | 138 ++-- ...atory_compliance_assessments_operations.py | 44 +- ...gulatory_compliance_controls_operations.py | 44 +- ...ulatory_compliance_standards_operations.py | 44 +- .../operations/_sub_assessments_operations.py | 64 +- .../mgmt/security/v2019_08_01/__init__.py | 2 +- .../security/v2019_08_01/_configuration.py | 7 +- .../mgmt/security/v2019_08_01/_metadata.json | 4 +- .../security/v2019_08_01/_security_center.py | 13 +- .../mgmt/security/v2019_08_01/_version.py | 2 +- .../mgmt/security/v2019_08_01/aio/__init__.py | 2 +- .../v2019_08_01/aio/_configuration.py | 2 +- .../v2019_08_01/aio/_security_center.py | 4 +- .../v2019_08_01/aio/operations/__init__.py | 2 +- .../_device_security_groups_operations.py | 54 +- ..._security_solution_analytics_operations.py | 24 +- .../_iot_security_solution_operations.py | 88 +-- ...s_analytics_aggregated_alert_operations.py | 40 +- ...ons_analytics_recommendation_operations.py | 28 +- .../security/v2019_08_01/models/__init__.py | 2 +- .../v2019_08_01/models/_models_py3.py | 52 +- .../v2019_08_01/operations/__init__.py | 2 +- .../_device_security_groups_operations.py | 72 ++- ..._security_solution_analytics_operations.py | 32 +- .../_iot_security_solution_operations.py | 116 ++-- ...s_analytics_aggregated_alert_operations.py | 52 +- ...ons_analytics_recommendation_operations.py | 36 +- .../mgmt/security/v2020_01_01/__init__.py | 2 +- .../security/v2020_01_01/_configuration.py | 7 +- .../mgmt/security/v2020_01_01/_metadata.json | 4 +- .../security/v2020_01_01/_security_center.py | 13 +- .../mgmt/security/v2020_01_01/_version.py | 2 +- .../mgmt/security/v2020_01_01/aio/__init__.py | 2 +- .../v2020_01_01/aio/_configuration.py | 2 +- .../v2020_01_01/aio/_security_center.py | 4 +- .../v2020_01_01/aio/operations/__init__.py | 2 +- ...daptive_application_controls_operations.py | 48 +- ..._adaptive_network_hardenings_operations.py | 68 +- .../_allowed_connections_operations.py | 42 +- .../_assessments_metadata_operations.py | 78 ++- .../aio/operations/_assessments_operations.py | 50 +- ...iscovered_security_solutions_operations.py | 42 +- ..._external_security_solutions_operations.py | 42 +- ..._jit_network_access_policies_operations.py | 118 ++-- ...re_score_control_definitions_operations.py | 30 +- .../_secure_score_controls_operations.py | 30 +- .../operations/_secure_scores_operations.py | 26 +- .../_security_solutions_operations.py | 26 +- ...ity_solutions_reference_data_operations.py | 24 +- ...ver_vulnerability_assessment_operations.py | 82 +-- .../aio/operations/_topology_operations.py | 42 +- .../security/v2020_01_01/models/__init__.py | 2 +- .../v2020_01_01/models/_models_py3.py | 8 +- .../v2020_01_01/operations/__init__.py | 2 +- ...daptive_application_controls_operations.py | 66 +- ..._adaptive_network_hardenings_operations.py | 86 +-- .../_allowed_connections_operations.py | 54 +- .../_assessments_metadata_operations.py | 102 +-- .../operations/_assessments_operations.py | 68 +- ...iscovered_security_solutions_operations.py | 54 +- ..._external_security_solutions_operations.py | 54 +- ..._jit_network_access_policies_operations.py | 158 ++--- ...re_score_control_definitions_operations.py | 36 +- .../_secure_score_controls_operations.py | 38 +- .../operations/_secure_scores_operations.py | 34 +- .../_security_solutions_operations.py | 34 +- ...ity_solutions_reference_data_operations.py | 32 +- ...ver_vulnerability_assessment_operations.py | 110 ++-- .../operations/_topology_operations.py | 54 +- .../security/v2020_01_01_preview/__init__.py | 2 +- .../v2020_01_01_preview/_configuration.py | 7 +- .../v2020_01_01_preview/_metadata.json | 4 +- .../v2020_01_01_preview/_security_center.py | 13 +- .../security/v2020_01_01_preview/_version.py | 2 +- .../v2020_01_01_preview/aio/__init__.py | 2 +- .../v2020_01_01_preview/aio/_configuration.py | 2 +- .../aio/_security_center.py | 4 +- .../aio/operations/__init__.py | 2 +- .../aio/operations/_connectors_operations.py | 56 +- .../v2020_01_01_preview/models/__init__.py | 2 +- .../v2020_01_01_preview/models/_models_py3.py | 8 +- .../operations/__init__.py | 2 +- .../operations/_connectors_operations.py | 82 +-- .../security/v2020_07_01_preview/__init__.py | 2 +- .../v2020_07_01_preview/_configuration.py | 7 +- .../v2020_07_01_preview/_metadata.json | 4 +- .../v2020_07_01_preview/_security_center.py | 13 +- .../security/v2020_07_01_preview/_version.py | 2 +- .../v2020_07_01_preview/aio/__init__.py | 2 +- .../v2020_07_01_preview/aio/_configuration.py | 2 +- .../aio/_security_center.py | 4 +- .../aio/operations/__init__.py | 2 +- ...ty_assessment_baseline_rules_operations.py | 74 ++- ...lity_assessment_scan_results_operations.py | 28 +- ...lnerability_assessment_scans_operations.py | 26 +- .../v2020_07_01_preview/models/__init__.py | 2 +- .../operations/__init__.py | 2 +- ...ty_assessment_baseline_rules_operations.py | 108 ++-- ...lity_assessment_scan_results_operations.py | 40 +- ...lnerability_assessment_scans_operations.py | 38 +- .../mgmt/security/v2021_01_01/__init__.py | 2 +- .../security/v2021_01_01/_configuration.py | 7 +- .../mgmt/security/v2021_01_01/_metadata.json | 4 +- .../security/v2021_01_01/_security_center.py | 13 +- .../mgmt/security/v2021_01_01/_version.py | 2 +- .../mgmt/security/v2021_01_01/aio/__init__.py | 2 +- .../v2021_01_01/aio/_configuration.py | 2 +- .../v2021_01_01/aio/_security_center.py | 4 +- .../v2021_01_01/aio/operations/__init__.py | 2 +- .../aio/operations/_alerts_operations.py | 192 +++--- .../security/v2021_01_01/models/__init__.py | 2 +- .../v2021_01_01/models/_models_py3.py | 10 +- .../v2021_01_01/operations/__init__.py | 2 +- .../operations/_alerts_operations.py | 246 +++---- .../security/v2021_01_15_preview/__init__.py | 2 +- .../v2021_01_15_preview/_configuration.py | 7 +- .../v2021_01_15_preview/_metadata.json | 4 +- .../v2021_01_15_preview/_security_center.py | 13 +- .../security/v2021_01_15_preview/_version.py | 2 +- .../v2021_01_15_preview/aio/__init__.py | 2 +- .../v2021_01_15_preview/aio/_configuration.py | 2 +- .../aio/_security_center.py | 4 +- .../aio/operations/__init__.py | 2 +- .../_ingestion_settings_operations.py | 88 +-- .../v2021_01_15_preview/models/__init__.py | 2 +- .../operations/__init__.py | 2 +- .../_ingestion_settings_operations.py | 126 ++-- .../security/v2021_05_01_preview/__init__.py | 2 +- .../v2021_05_01_preview/_configuration.py | 7 +- .../v2021_05_01_preview/_metadata.json | 4 +- .../v2021_05_01_preview/_security_center.py | 13 +- .../security/v2021_05_01_preview/_version.py | 2 +- .../v2021_05_01_preview/aio/__init__.py | 2 +- .../v2021_05_01_preview/aio/_configuration.py | 2 +- .../aio/_security_center.py | 4 +- .../aio/operations/__init__.py | 2 +- .../_software_inventories_operations.py | 50 +- .../v2021_05_01_preview/models/__init__.py | 2 +- .../operations/__init__.py | 2 +- .../_software_inventories_operations.py | 68 +- .../mgmt/security/v2021_06_01/__init__.py | 2 +- .../security/v2021_06_01/_configuration.py | 7 +- .../mgmt/security/v2021_06_01/_metadata.json | 4 +- .../security/v2021_06_01/_security_center.py | 13 +- .../mgmt/security/v2021_06_01/_version.py | 2 +- .../mgmt/security/v2021_06_01/aio/__init__.py | 2 +- .../v2021_06_01/aio/_configuration.py | 2 +- .../v2021_06_01/aio/_security_center.py | 4 +- .../v2021_06_01/aio/operations/__init__.py | 2 +- .../_assessments_metadata_operations.py | 78 ++- .../aio/operations/_assessments_operations.py | 50 +- .../aio/operations/_settings_operations.py | 36 +- .../security/v2021_06_01/models/__init__.py | 2 +- .../v2021_06_01/models/_models_py3.py | 14 +- .../v2021_06_01/operations/__init__.py | 2 +- .../_assessments_metadata_operations.py | 102 +-- .../operations/_assessments_operations.py | 68 +- .../operations/_settings_operations.py | 50 +- .../mgmt/security/v2021_07_01/__init__.py | 2 +- .../security/v2021_07_01/_configuration.py | 7 +- .../mgmt/security/v2021_07_01/_metadata.json | 4 +- .../security/v2021_07_01/_security_center.py | 13 +- .../mgmt/security/v2021_07_01/_version.py | 2 +- .../mgmt/security/v2021_07_01/aio/__init__.py | 2 +- .../v2021_07_01/aio/_configuration.py | 2 +- .../v2021_07_01/aio/_security_center.py | 4 +- .../v2021_07_01/aio/operations/__init__.py | 2 +- .../aio/operations/_settings_operations.py | 36 +- .../security/v2021_07_01/models/__init__.py | 2 +- .../v2021_07_01/models/_models_py3.py | 6 +- .../v2021_07_01/operations/__init__.py | 2 +- .../operations/_settings_operations.py | 50 +- .../security/v2021_07_01_preview/__init__.py | 2 +- .../v2021_07_01_preview/_configuration.py | 7 +- .../v2021_07_01_preview/_metadata.json | 4 +- .../v2021_07_01_preview/_security_center.py | 13 +- .../security/v2021_07_01_preview/_version.py | 2 +- .../v2021_07_01_preview/aio/__init__.py | 2 +- .../v2021_07_01_preview/aio/_configuration.py | 2 +- .../aio/_security_center.py | 4 +- .../aio/operations/__init__.py | 2 +- ...ustom_assessment_automations_operations.py | 84 +-- ...tom_entity_store_assignments_operations.py | 84 +-- .../_security_connectors_operations.py | 98 +-- .../v2021_07_01_preview/models/__init__.py | 2 +- .../v2021_07_01_preview/models/_models_py3.py | 10 +- .../operations/__init__.py | 2 +- ...ustom_assessment_automations_operations.py | 116 ++-- ...tom_entity_store_assignments_operations.py | 116 ++-- .../_security_connectors_operations.py | 138 ++-- .../security/v2021_10_01_preview/__init__.py | 2 +- .../v2021_10_01_preview/_configuration.py | 7 +- .../v2021_10_01_preview/_metadata.json | 4 +- .../v2021_10_01_preview/_security_center.py | 13 +- .../security/v2021_10_01_preview/_version.py | 2 +- .../v2021_10_01_preview/aio/__init__.py | 2 +- .../v2021_10_01_preview/aio/_configuration.py | 2 +- .../aio/_security_center.py | 4 +- .../aio/operations/__init__.py | 2 +- .../operations/_mde_onboardings_operations.py | 24 +- .../v2021_10_01_preview/models/__init__.py | 2 +- .../operations/__init__.py | 2 +- .../operations/_mde_onboardings_operations.py | 36 +- .../mgmt/security/v2022_01_01/__init__.py | 2 +- .../security/v2022_01_01/_configuration.py | 7 +- .../mgmt/security/v2022_01_01/_metadata.json | 4 +- .../security/v2022_01_01/_security_center.py | 13 +- .../mgmt/security/v2022_01_01/_version.py | 2 +- .../mgmt/security/v2022_01_01/aio/__init__.py | 2 +- .../v2022_01_01/aio/_configuration.py | 2 +- .../v2022_01_01/aio/_security_center.py | 4 +- .../v2022_01_01/aio/operations/__init__.py | 2 +- .../aio/operations/_alerts_operations.py | 216 ++++--- .../security/v2022_01_01/models/__init__.py | 2 +- .../v2022_01_01/models/_models_py3.py | 10 +- .../v2022_01_01/operations/__init__.py | 2 +- .../operations/_alerts_operations.py | 278 ++++---- .../security/v2022_01_01_preview/__init__.py | 2 +- .../v2022_01_01_preview/_configuration.py | 16 +- .../v2022_01_01_preview/_metadata.json | 25 +- .../v2022_01_01_preview/_security_center.py | 70 +- .../security/v2022_01_01_preview/_version.py | 2 +- .../v2022_01_01_preview/aio/__init__.py | 2 +- .../v2022_01_01_preview/aio/_configuration.py | 11 +- .../aio/_security_center.py | 61 +- .../aio/operations/__init__.py | 22 +- .../_governance_assignments_operations.py | 112 ++-- .../operations/_governance_rule_operations.py | 18 +- .../_governance_rules_operations.py | 408 +++++++++--- ...gement_group_governance_rule_operations.py | 142 +++++ ...nance_rules_operation_result_operations.py | 129 ++++ ...ement_group_governance_rules_operations.py | 367 +++++++++++ ...ty_connector_governance_rule_operations.py | 20 +- ...ernance_rules_execute_status_operations.py | 195 ------ ...nance_rules_operation_result_operations.py | 136 ++++ ...y_connector_governance_rules_operations.py | 178 ++++-- ...ernance_rules_execute_status_operations.py | 184 ------ ...nance_rules_operation_result_operations.py | 129 ++++ .../v2022_01_01_preview/models/__init__.py | 10 +- .../v2022_01_01_preview/models/_models_py3.py | 154 +++-- .../models/_security_center_enums.py | 11 + .../operations/__init__.py | 22 +- .../_governance_assignments_operations.py | 146 +++-- .../operations/_governance_rule_operations.py | 24 +- .../_governance_rules_operations.py | 482 ++++++++++---- ...gement_group_governance_rule_operations.py | 174 +++++ ...nance_rules_operation_result_operations.py | 161 +++++ ...ement_group_governance_rules_operations.py | 451 +++++++++++++ ...ty_connector_governance_rule_operations.py | 30 +- ...ance_rules_operation_result_operations.py} | 139 ++-- ...y_connector_governance_rules_operations.py | 210 ++++-- ...ance_rules_operation_result_operations.py} | 119 +--- .../mgmt/security/v2022_03_01/__init__.py | 2 +- .../security/v2022_03_01/_configuration.py | 7 +- .../mgmt/security/v2022_03_01/_metadata.json | 4 +- .../security/v2022_03_01/_security_center.py | 13 +- .../mgmt/security/v2022_03_01/_version.py | 2 +- .../mgmt/security/v2022_03_01/aio/__init__.py | 2 +- .../v2022_03_01/aio/_configuration.py | 2 +- .../v2022_03_01/aio/_security_center.py | 4 +- .../v2022_03_01/aio/operations/__init__.py | 2 +- .../aio/operations/_pricings_operations.py | 32 +- .../security/v2022_03_01/models/__init__.py | 2 +- .../v2022_03_01/operations/__init__.py | 2 +- .../operations/_pricings_operations.py | 46 +- .../mgmt/security/v2022_05_01/__init__.py | 2 +- .../security/v2022_05_01/_configuration.py | 7 +- .../mgmt/security/v2022_05_01/_metadata.json | 4 +- .../security/v2022_05_01/_security_center.py | 13 +- .../mgmt/security/v2022_05_01/_version.py | 2 +- .../mgmt/security/v2022_05_01/aio/__init__.py | 2 +- .../v2022_05_01/aio/_configuration.py | 2 +- .../v2022_05_01/aio/_security_center.py | 4 +- .../v2022_05_01/aio/operations/__init__.py | 2 +- .../aio/operations/_settings_operations.py | 36 +- .../security/v2022_05_01/models/__init__.py | 2 +- .../v2022_05_01/models/_models_py3.py | 6 +- .../v2022_05_01/operations/__init__.py | 2 +- .../operations/_settings_operations.py | 50 +- .../security/v2022_05_01_preview/__init__.py | 2 +- .../v2022_05_01_preview/_configuration.py | 7 +- .../v2022_05_01_preview/_metadata.json | 4 +- .../v2022_05_01_preview/_security_center.py | 13 +- .../security/v2022_05_01_preview/_version.py | 2 +- .../v2022_05_01_preview/aio/__init__.py | 2 +- .../v2022_05_01_preview/aio/_configuration.py | 2 +- .../aio/_security_center.py | 4 +- .../aio/operations/__init__.py | 2 +- .../_security_connectors_operations.py | 98 +-- .../v2022_05_01_preview/models/__init__.py | 2 +- .../v2022_05_01_preview/models/_models_py3.py | 46 +- .../operations/__init__.py | 2 +- .../_security_connectors_operations.py | 138 ++-- .../security/v2022_07_01_preview/__init__.py | 2 +- .../v2022_07_01_preview/_configuration.py | 7 +- .../v2022_07_01_preview/_metadata.json | 4 +- .../v2022_07_01_preview/_security_center.py | 13 +- .../security/v2022_07_01_preview/_version.py | 2 +- .../v2022_07_01_preview/aio/__init__.py | 2 +- .../v2022_07_01_preview/aio/_configuration.py | 2 +- .../aio/_security_center.py | 4 +- .../aio/operations/__init__.py | 2 +- .../aio/operations/_application_operations.py | 46 +- .../operations/_applications_operations.py | 16 +- ...curity_connector_application_operations.py | 48 +- ...urity_connector_applications_operations.py | 18 +- .../v2022_07_01_preview/models/__init__.py | 2 +- .../operations/__init__.py | 2 +- .../operations/_application_operations.py | 66 +- .../operations/_applications_operations.py | 22 +- ...curity_connector_application_operations.py | 68 +- ...urity_connector_applications_operations.py | 24 +- .../security/v2022_08_01_preview/__init__.py | 2 +- .../v2022_08_01_preview/_configuration.py | 7 +- .../v2022_08_01_preview/_metadata.json | 4 +- .../v2022_08_01_preview/_security_center.py | 13 +- .../security/v2022_08_01_preview/_version.py | 2 +- .../v2022_08_01_preview/aio/__init__.py | 2 +- .../v2022_08_01_preview/aio/_configuration.py | 2 +- .../aio/_security_center.py | 4 +- .../aio/operations/__init__.py | 2 +- .../_security_connectors_operations.py | 98 +-- .../v2022_08_01_preview/models/__init__.py | 2 +- .../v2022_08_01_preview/models/_models_py3.py | 54 +- .../operations/__init__.py | 2 +- .../_security_connectors_operations.py | 138 ++-- 428 files changed, 8495 insertions(+), 5898 deletions(-) create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_management_group_governance_rule_operations.py create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_management_group_governance_rules_operation_result_operations.py create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_management_group_governance_rules_operations.py delete mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_security_connector_governance_rules_execute_status_operations.py create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_security_connector_governance_rules_operation_result_operations.py delete mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_subscription_governance_rules_execute_status_operations.py create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_subscription_governance_rules_operation_result_operations.py create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_management_group_governance_rule_operations.py create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_management_group_governance_rules_operation_result_operations.py create mode 100644 sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_management_group_governance_rules_operations.py rename sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/{_security_connector_governance_rules_execute_status_operations.py => _security_connector_governance_rules_operation_result_operations.py} (54%) rename sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/{_subscription_governance_rules_execute_status_operations.py => _subscription_governance_rules_operation_result_operations.py} (53%) diff --git a/sdk/security/azure-mgmt-security/_meta.json b/sdk/security/azure-mgmt-security/_meta.json index a57d3149f444..d9b69e9bcb46 100644 --- a/sdk/security/azure-mgmt-security/_meta.json +++ b/sdk/security/azure-mgmt-security/_meta.json @@ -1,11 +1,11 @@ { - "commit": "8a20cee044fafde7ae0364edab45a577aa80d20f", + "commit": "6be9905597d8b6eb4b0c88dc619270dd27e9ac0b", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.1", + "@autorest/python@6.2.7", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/security/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/security/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/security/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/_configuration.py index 065a74405620..0bfeac5dfa1e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/_configuration.py @@ -36,9 +36,8 @@ def __init__( self, credential: "TokenCredential", subscription_id: str, - **kwargs # type: Any + **kwargs: Any ): - # type: (...) -> None if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -53,9 +52,8 @@ def __init__( def _configure( self, - **kwargs # type: Any + **kwargs: Any ): - # type: (...) -> None self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py index a9cabbbfa717..0e9b5cba376b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py @@ -87,6 +87,9 @@ class SecurityCenter(MultiApiClientMixin, _SDKClient): 'iot_security_solutions_analytics_recommendation': '2019-08-01', 'jit_network_access_policies': '2020-01-01', 'locations': '2015-06-01-preview', + 'management_group_governance_rule': '2022-01-01-preview', + 'management_group_governance_rules': '2022-01-01-preview', + 'management_group_governance_rules_operation_result': '2022-01-01-preview', 'mde_onboardings': '2021-10-01-preview', 'operations': '2015-06-01-preview', 'pricings': '2022-03-01', @@ -98,7 +101,7 @@ class SecurityCenter(MultiApiClientMixin, _SDKClient): 'secure_scores': '2020-01-01', 'security_connector_governance_rule': '2022-01-01-preview', 'security_connector_governance_rules': '2022-01-01-preview', - 'security_connector_governance_rules_execute_status': '2022-01-01-preview', + 'security_connector_governance_rules_operation_result': '2022-01-01-preview', 'security_contacts': '2017-08-01-preview', 'security_solutions': '2020-01-01', 'security_solutions_reference_data': '2020-01-01', @@ -108,7 +111,7 @@ class SecurityCenter(MultiApiClientMixin, _SDKClient): 'sql_vulnerability_assessment_scan_results': '2020-07-01-preview', 'sql_vulnerability_assessment_scans': '2020-07-01-preview', 'sub_assessments': '2019-01-01-preview', - 'subscription_governance_rules_execute_status': '2022-01-01-preview', + 'subscription_governance_rules_operation_result': '2022-01-01-preview', 'tasks': '2015-06-01-preview', 'topology': '2020-01-01', 'workspace_settings': '2017-08-01-preview', @@ -120,10 +123,10 @@ def __init__( self, credential: "TokenCredential", subscription_id: str, - api_version=None, # type: Optional[str] + api_version: Optional[str]=None, base_url: str = "https://management.azure.com", - profile=KnownProfiles.default, # type: KnownProfiles - **kwargs # type: Any + profile: KnownProfiles=KnownProfiles.default, + **kwargs: Any ): self._config = SecurityCenterConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) @@ -682,6 +685,48 @@ def locations(self): self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def management_group_governance_rule(self): + """Instance depends on the API version: + + * 2022-01-01-preview: :class:`ManagementGroupGovernanceRuleOperations` + """ + api_version = self._get_api_version('management_group_governance_rule') + if api_version == '2022-01-01-preview': + from .v2022_01_01_preview.operations import ManagementGroupGovernanceRuleOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'management_group_governance_rule'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def management_group_governance_rules(self): + """Instance depends on the API version: + + * 2022-01-01-preview: :class:`ManagementGroupGovernanceRulesOperations` + """ + api_version = self._get_api_version('management_group_governance_rules') + if api_version == '2022-01-01-preview': + from .v2022_01_01_preview.operations import ManagementGroupGovernanceRulesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'management_group_governance_rules'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def management_group_governance_rules_operation_result(self): + """Instance depends on the API version: + + * 2022-01-01-preview: :class:`ManagementGroupGovernanceRulesOperationResultOperations` + """ + api_version = self._get_api_version('management_group_governance_rules_operation_result') + if api_version == '2022-01-01-preview': + from .v2022_01_01_preview.operations import ManagementGroupGovernanceRulesOperationResultOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'management_group_governance_rules_operation_result'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def mde_onboardings(self): """Instance depends on the API version: @@ -868,16 +913,16 @@ def security_connector_governance_rules(self): return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property - def security_connector_governance_rules_execute_status(self): + def security_connector_governance_rules_operation_result(self): """Instance depends on the API version: - * 2022-01-01-preview: :class:`SecurityConnectorGovernanceRulesExecuteStatusOperations` + * 2022-01-01-preview: :class:`SecurityConnectorGovernanceRulesOperationResultOperations` """ - api_version = self._get_api_version('security_connector_governance_rules_execute_status') + api_version = self._get_api_version('security_connector_governance_rules_operation_result') if api_version == '2022-01-01-preview': - from .v2022_01_01_preview.operations import SecurityConnectorGovernanceRulesExecuteStatusOperations as OperationClass + from .v2022_01_01_preview.operations import SecurityConnectorGovernanceRulesOperationResultOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'security_connector_governance_rules_execute_status'".format(api_version)) + raise ValueError("API version {} does not have operation group 'security_connector_governance_rules_operation_result'".format(api_version)) self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1048,16 +1093,16 @@ def sub_assessments(self): return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property - def subscription_governance_rules_execute_status(self): + def subscription_governance_rules_operation_result(self): """Instance depends on the API version: - * 2022-01-01-preview: :class:`SubscriptionGovernanceRulesExecuteStatusOperations` + * 2022-01-01-preview: :class:`SubscriptionGovernanceRulesOperationResultOperations` """ - api_version = self._get_api_version('subscription_governance_rules_execute_status') + api_version = self._get_api_version('subscription_governance_rules_operation_result') if api_version == '2022-01-01-preview': - from .v2022_01_01_preview.operations import SubscriptionGovernanceRulesExecuteStatusOperations as OperationClass + from .v2022_01_01_preview.operations import SubscriptionGovernanceRulesOperationResultOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'subscription_governance_rules_execute_status'".format(api_version)) + raise ValueError("API version {} does not have operation group 'subscription_governance_rules_operation_result'".format(api_version)) self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/_serialization.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/_serialization.py index 240df16c57f3..2c170e28dbca 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/_serialization.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/_serialization.py @@ -25,6 +25,7 @@ # -------------------------------------------------------------------------- # pylint: skip-file +# pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode import calendar @@ -37,34 +38,33 @@ import re import sys import codecs +from typing import Optional, Union, AnyStr, IO, Mapping + try: from urllib import quote # type: ignore except ImportError: - from urllib.parse import quote # type: ignore + from urllib.parse import quote import xml.etree.ElementTree as ET -import isodate +import isodate # type: ignore -from typing import Dict, Any, cast, TYPE_CHECKING +from typing import Dict, Any, cast from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback -_BOM = codecs.BOM_UTF8.decode(encoding='utf-8') +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -if TYPE_CHECKING: - from typing import Optional, Union, AnyStr, IO, Mapping class RawDeserializer: # Accept "text" because we're open minded people... - JSON_REGEXP = re.compile(r'^(application|text)/([a-z+.]+\+)?json$') + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") # Name used in context CONTEXT_NAME = "deserialized_data" @classmethod - def deserialize_from_text(cls, data, content_type=None): - # type: (Optional[Union[AnyStr, IO]], Optional[str]) -> Any + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: """Decode data according to content-type. Accept a stream of data as well, but will be load at once in memory for now. @@ -75,12 +75,12 @@ def deserialize_from_text(cls, data, content_type=None): :type data: str or bytes or IO :param str content_type: The content type. """ - if hasattr(data, 'read'): + if hasattr(data, "read"): # Assume a stream data = cast(IO, data).read() if isinstance(data, bytes): - data_as_str = data.decode(encoding='utf-8-sig') + data_as_str = data.decode(encoding="utf-8-sig") else: # Explain to mypy the correct type. data_as_str = cast(str, data) @@ -116,7 +116,8 @@ def _json_attemp(data): try: return True, json.loads(data) except ValueError: - return False, None # Don't care about this one + return False, None # Don't care about this one + success, json_result = _json_attemp(data) if success: return json_result @@ -129,8 +130,7 @@ def _json_attemp(data): raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) @classmethod - def deserialize_from_http_generics(cls, body_bytes, headers): - # type: (Optional[Union[AnyStr, IO]], Mapping) -> Any + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: """Deserialize from HTTP response. Use bytes and headers to NOT use any requests/aiohttp or whatever @@ -139,8 +139,8 @@ def deserialize_from_http_generics(cls, body_bytes, headers): """ # Try to use content-type from headers if available content_type = None - if 'content-type' in headers: - content_type = headers['content-type'].split(";")[0].strip().lower() + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() # Ouch, this server did not declare what it sent... # Let's guess it's JSON... # Also, since Autorest was considering that an empty body was a valid JSON, @@ -152,20 +152,22 @@ def deserialize_from_http_generics(cls, body_bytes, headers): return cls.deserialize_from_text(body_bytes, content_type) return None + try: basestring # type: ignore unicode_str = unicode # type: ignore except NameError: - basestring = str # type: ignore - unicode_str = str # type: ignore + basestring = str + unicode_str = str _LOGGER = logging.getLogger(__name__) try: - _long_type = long # type: ignore + _long_type = long # type: ignore except NameError: _long_type = int + class UTC(datetime.tzinfo): """Time Zone info for handling UTC""" @@ -181,9 +183,11 @@ def dst(self, dt): """No daylight saving for UTC.""" return datetime.timedelta(hours=1) + try: - from datetime import timezone as _FixedOffset + from datetime import timezone as _FixedOffset # type: ignore except ImportError: # Python 2.7 + class _FixedOffset(datetime.tzinfo): # type: ignore """Fixed offset in minutes east from UTC. Copy/pasted from Python doc @@ -197,7 +201,7 @@ def utcoffset(self, dt): return self.__offset def tzname(self, dt): - return str(self.__offset.total_seconds()/3600) + return str(self.__offset.total_seconds() / 3600) def __repr__(self): return "".format(self.tzname(None)) @@ -208,14 +212,17 @@ def dst(self, dt): def __getinitargs__(self): return (self.__offset,) + try: from datetime import timezone - TZ_UTC = timezone.utc # type: ignore + + TZ_UTC = timezone.utc except ImportError: TZ_UTC = UTC() # type: ignore _FLATTEN = re.compile(r"(? y, @@ -502,25 +515,25 @@ class Serializer(object): "max_items": lambda x, y: len(x) > y, "pattern": lambda x, y: not re.match(y, x, re.UNICODE), "unique": lambda x, y: len(x) != len(set(x)), - "multiple": lambda x, y: x % y != 0 - } + "multiple": lambda x, y: x % y != 0, + } def __init__(self, classes=None): self.serialize_type = { - 'iso-8601': Serializer.serialize_iso, - 'rfc-1123': Serializer.serialize_rfc, - 'unix-time': Serializer.serialize_unix, - 'duration': Serializer.serialize_duration, - 'date': Serializer.serialize_date, - 'time': Serializer.serialize_time, - 'decimal': Serializer.serialize_decimal, - 'long': Serializer.serialize_long, - 'bytearray': Serializer.serialize_bytearray, - 'base64': Serializer.serialize_base64, - 'object': self.serialize_object, - '[]': self.serialize_iter, - '{}': self.serialize_dict - } + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } self.dependencies = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -542,14 +555,12 @@ def _serialize(self, target_obj, data_type=None, **kwargs): class_name = target_obj.__class__.__name__ if data_type: - return self.serialize_data( - target_obj, data_type, **kwargs) + return self.serialize_data(target_obj, data_type, **kwargs) if not hasattr(target_obj, "_attribute_map"): data_type = type(target_obj).__name__ if data_type in self.basic_types.values(): - return self.serialize_data( - target_obj, data_type, **kwargs) + return self.serialize_data(target_obj, data_type, **kwargs) # Force "is_xml" kwargs if we detect a XML model try: @@ -564,10 +575,10 @@ def _serialize(self, target_obj, data_type=None, **kwargs): attributes = target_obj._attribute_map for attr, attr_desc in attributes.items(): attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get('readonly', False): + if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): continue - if attr_name == "additional_properties" and attr_desc["key"] == '': + if attr_name == "additional_properties" and attr_desc["key"] == "": if target_obj.additional_properties is not None: serialized.update(target_obj.additional_properties) continue @@ -575,68 +586,61 @@ def _serialize(self, target_obj, data_type=None, **kwargs): orig_attr = getattr(target_obj, attr) if is_xml_model_serialization: - pass # Don't provide "transformer" for XML for now. Keep "orig_attr" - else: # JSON + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) keys = keys if isinstance(keys, list) else [keys] - kwargs["serialization_ctxt"] = attr_desc - new_attr = self.serialize_data(orig_attr, attr_desc['type'], **kwargs) - + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) if is_xml_model_serialization: - xml_desc = attr_desc.get('xml', {}) - xml_name = xml_desc.get('name', attr_desc['key']) - xml_prefix = xml_desc.get('prefix', None) - xml_ns = xml_desc.get('ns', None) + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) if xml_desc.get("attr", False): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) xml_name = "{}{}".format(xml_ns, xml_name) - serialized.set(xml_name, new_attr) + serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): - serialized.text = new_attr + serialized.text = new_attr # type: ignore continue if isinstance(new_attr, list): - serialized.extend(new_attr) + serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. - if 'name' not in getattr(orig_attr, '_xml_map', {}): + if "name" not in getattr(orig_attr, "_xml_map", {}): splitted_tag = new_attr.tag.split("}") - if len(splitted_tag) == 2: # Namespace + if len(splitted_tag) == 2: # Namespace new_attr.tag = "}".join([splitted_tag[0], xml_name]) else: new_attr.tag = xml_name - serialized.append(new_attr) + serialized.append(new_attr) # type: ignore else: # That's a basic type # Integrate namespace if necessary - local_node = _create_xml_node( - xml_name, - xml_prefix, - xml_ns - ) + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) local_node.text = unicode_str(new_attr) - serialized.append(local_node) - else: # JSON - for k in reversed(keys): + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore unflattened = {k: new_attr} new_attr = unflattened _new_attr = new_attr _serialized = serialized - for k in keys: + for k in keys: # type: ignore if k not in _serialized: - _serialized.update(_new_attr) - _new_attr = _new_attr[k] + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] except ValueError: continue except (AttributeError, KeyError, TypeError) as err: - msg = "Attribute {} in object {} cannot be serialized.\n{}".format( - attr_name, class_name, str(target_obj)) + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) raise_with_traceback(SerializationError, msg, err) else: return serialized @@ -652,7 +656,7 @@ def body(self, data, data_type, **kwargs): """ # Just in case this is a dict - internal_data_type = data_type.strip('[]{}') + internal_data_type = data_type.strip("[]{}") internal_data_type = self.dependencies.get(internal_data_type, None) try: is_xml_model_serialization = kwargs["is_xml"] @@ -668,19 +672,18 @@ def body(self, data, data_type, **kwargs): # We're not able to deal with additional properties for now. deserializer.additional_properties_detection = False if is_xml_model_serialization: - deserializer.key_extractors = [ + deserializer.key_extractors = [ # type: ignore attribute_key_case_insensitive_extractor, ] else: deserializer.key_extractors = [ rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor, - last_rest_key_case_insensitive_extractor + last_rest_key_case_insensitive_extractor, ] data = deserializer._deserialize(data_type, data) except DeserializationError as err: - raise_with_traceback( - SerializationError, "Unable to build a model: "+str(err), err) + raise_with_traceback(SerializationError, "Unable to build a model: " + str(err), err) return self._serialize(data, data_type, **kwargs) @@ -695,13 +698,13 @@ def url(self, name, data, data_type, **kwargs): """ try: output = self.serialize_data(data, data_type, **kwargs) - if data_type == 'bool': + if data_type == "bool": output = json.dumps(output) - if kwargs.get('skip_quote') is True: + if kwargs.get("skip_quote") is True: output = str(output) else: - output = quote(str(output), safe='') + output = quote(str(output), safe="") except SerializationError: raise TypeError("{} must be type {}.".format(name, data_type)) else: @@ -720,27 +723,19 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [ - self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" - for d - in data - ] - if not kwargs.get('skip_quote', False): - data = [ - quote(str(d), safe='') - for d - in data - ] + data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] + if not kwargs.get("skip_quote", False): + data = [quote(str(d), safe="") for d in data] return str(self.serialize_iter(data, internal_data_type, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) - if data_type == 'bool': + if data_type == "bool": output = json.dumps(output) - if kwargs.get('skip_quote') is True: + if kwargs.get("skip_quote") is True: output = str(output) else: - output = quote(str(output), safe='') + output = quote(str(output), safe="") except SerializationError: raise TypeError("{} must be type {}.".format(name, data_type)) else: @@ -756,11 +751,11 @@ def header(self, name, data, data_type, **kwargs): :raises: ValueError if data is None """ try: - if data_type in ['[str]']: + if data_type in ["[str]"]: data = ["" if d is None else d for d in data] output = self.serialize_data(data, data_type, **kwargs) - if data_type == 'bool': + if data_type == "bool": output = json.dumps(output) except SerializationError: raise TypeError("{} must be type {}.".format(name, data_type)) @@ -796,13 +791,11 @@ def serialize_data(self, data, data_type, **kwargs): iter_type = data_type[0] + data_type[-1] if iter_type in self.serialize_type: - return self.serialize_type[iter_type]( - data, data_type[1:-1], **kwargs) + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." - raise_with_traceback( - SerializationError, msg.format(data, data_type), err) + raise_with_traceback(SerializationError, msg.format(data, data_type), err) else: return self._serialize(data, **kwargs) @@ -829,7 +822,7 @@ def serialize_basic(cls, data, data_type, **kwargs): custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) - if data_type == 'str': + if data_type == "str": return cls.serialize_unicode(data) return eval(data_type)(data) # nosec @@ -847,7 +840,7 @@ def serialize_unicode(cls, data): pass try: - if isinstance(data, unicode): + if isinstance(data, unicode): # type: ignore # Don't change it, JSON and XML ElementTree are totally able # to serialize correctly u'' strings return data @@ -886,25 +879,21 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): serialized.append(None) if div: - serialized = ['' if s is None else str(s) for s in serialized] + serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) - if 'xml' in serialization_ctxt or is_xml: + if "xml" in serialization_ctxt or is_xml: # XML serialization is more complicated - xml_desc = serialization_ctxt.get('xml', {}) - xml_name = xml_desc.get('name') + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") if not xml_name: - xml_name = serialization_ctxt['key'] + xml_name = serialization_ctxt["key"] # Create a wrap node if necessary (use the fact that Element and list have "append") is_wrapped = xml_desc.get("wrapped", False) node_name = xml_desc.get("itemsName", xml_name) if is_wrapped: - final_result = _create_xml_node( - xml_name, - xml_desc.get('prefix', None), - xml_desc.get('ns', None) - ) + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) else: final_result = [] # All list elements to "local_node" @@ -912,11 +901,7 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): if isinstance(el, ET.Element): el_node = el else: - el_node = _create_xml_node( - node_name, - xml_desc.get('prefix', None), - xml_desc.get('ns', None) - ) + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) if el is not None: # Otherwise it writes "None" :-p el_node.text = str(el) final_result.append(el_node) @@ -936,21 +921,16 @@ def serialize_dict(self, attr, dict_type, **kwargs): serialized = {} for key, value in attr.items(): try: - serialized[self.serialize_unicode(key)] = self.serialize_data( - value, dict_type, **kwargs) + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) except ValueError: serialized[self.serialize_unicode(key)] = None - if 'xml' in serialization_ctxt: + if "xml" in serialization_ctxt: # XML serialization is more complicated - xml_desc = serialization_ctxt['xml'] - xml_name = xml_desc['name'] + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] - final_result = _create_xml_node( - xml_name, - xml_desc.get('prefix', None), - xml_desc.get('ns', None) - ) + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) for key, value in serialized.items(): ET.SubElement(final_result, key).text = value return final_result @@ -996,8 +976,7 @@ def serialize_object(self, attr, **kwargs): serialized = {} for key, value in attr.items(): try: - serialized[self.serialize_unicode(key)] = self.serialize_object( - value, **kwargs) + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) except ValueError: serialized[self.serialize_unicode(key)] = None return serialized @@ -1006,8 +985,7 @@ def serialize_object(self, attr, **kwargs): serialized = [] for obj in attr: try: - serialized.append(self.serialize_object( - obj, **kwargs)) + serialized.append(self.serialize_object(obj, **kwargs)) except ValueError: pass return serialized @@ -1020,10 +998,10 @@ def serialize_enum(attr, enum_obj=None): except AttributeError: result = attr try: - enum_obj(result) + enum_obj(result) # type: ignore return result except ValueError: - for enum_value in enum_obj: + for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" @@ -1045,8 +1023,8 @@ def serialize_base64(attr, **kwargs): :param attr: Object to be serialized. :rtype: str """ - encoded = b64encode(attr).decode('ascii') - return encoded.strip('=').replace('+', '-').replace('/', '_') + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") @staticmethod def serialize_decimal(attr, **kwargs): @@ -1113,16 +1091,20 @@ def serialize_rfc(attr, **kwargs): """ try: if not attr.tzinfo: - _LOGGER.warning( - "Datetime with no tzinfo will be considered UTC.") + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") utc = attr.utctimetuple() except AttributeError: raise TypeError("RFC1123 object must be valid Datetime object.") return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( - Serializer.days[utc.tm_wday], utc.tm_mday, - Serializer.months[utc.tm_mon], utc.tm_year, - utc.tm_hour, utc.tm_min, utc.tm_sec) + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) @staticmethod def serialize_iso(attr, **kwargs): @@ -1136,19 +1118,18 @@ def serialize_iso(attr, **kwargs): attr = isodate.parse_datetime(attr) try: if not attr.tzinfo: - _LOGGER.warning( - "Datetime with no tzinfo will be considered UTC.") + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") utc = attr.utctimetuple() if utc.tm_year > 9999 or utc.tm_year < 1: raise OverflowError("Hit max or min date") - microseconds = str(attr.microsecond).rjust(6,'0').rstrip('0').ljust(3, '0') + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") if microseconds: - microseconds = '.'+microseconds + microseconds = "." + microseconds date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( - utc.tm_year, utc.tm_mon, utc.tm_mday, - utc.tm_hour, utc.tm_min, utc.tm_sec) - return date + microseconds + 'Z' + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" except (ValueError, OverflowError) as err: msg = "Unable to serialize datetime object." raise_with_traceback(SerializationError, msg, err) @@ -1169,17 +1150,17 @@ def serialize_unix(attr, **kwargs): return attr try: if not attr.tzinfo: - _LOGGER.warning( - "Datetime with no tzinfo will be considered UTC.") + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") return int(calendar.timegm(attr.utctimetuple())) except AttributeError: raise TypeError("Unix time object must be valid Datetime object.") + def rest_key_extractor(attr, attr_desc, data): - key = attr_desc['key'] + key = attr_desc["key"] working_data = data - while '.' in key: + while "." in key: dict_keys = _FLATTEN.split(key) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) @@ -1191,15 +1172,16 @@ def rest_key_extractor(attr, attr_desc, data): # that all properties under are None as well # https://github.com/Azure/msrest-for-python/issues/197 return None - key = '.'.join(dict_keys[1:]) + key = ".".join(dict_keys[1:]) return working_data.get(key) + def rest_key_case_insensitive_extractor(attr, attr_desc, data): - key = attr_desc['key'] + key = attr_desc["key"] working_data = data - while '.' in key: + while "." in key: dict_keys = _FLATTEN.split(key) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) @@ -1211,30 +1193,33 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): # that all properties under are None as well # https://github.com/Azure/msrest-for-python/issues/197 return None - key = '.'.join(dict_keys[1:]) + key = ".".join(dict_keys[1:]) if working_data: return attribute_key_case_insensitive_extractor(key, None, working_data) + def last_rest_key_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key. - """ - key = attr_desc['key'] + """Extract the attribute in "data" based on the last part of the JSON path key.""" + key = attr_desc["key"] dict_keys = _FLATTEN.split(key) return attribute_key_extractor(dict_keys[-1], None, data) + def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): """Extract the attribute in "data" based on the last part of the JSON path key. This is the case insensitive version of "last_rest_key_extractor" """ - key = attr_desc['key'] + key = attr_desc["key"] dict_keys = _FLATTEN.split(key) return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + def attribute_key_extractor(attr, _, data): return data.get(attr) + def attribute_key_case_insensitive_extractor(attr, _, data): found_key = None lower_attr = attr.lower() @@ -1245,6 +1230,7 @@ def attribute_key_case_insensitive_extractor(attr, _, data): return data.get(found_key) + def _extract_name_from_internal_type(internal_type): """Given an internal type XML description, extract correct XML name with namespace. @@ -1253,7 +1239,7 @@ def _extract_name_from_internal_type(internal_type): :returns: A tuple XML name + namespace dict """ internal_type_xml_map = getattr(internal_type, "_xml_map", {}) - xml_name = internal_type_xml_map.get('name', internal_type.__name__) + 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) @@ -1268,17 +1254,17 @@ def xml_key_extractor(attr, attr_desc, data): if not isinstance(data, ET.Element): return None - xml_desc = attr_desc.get('xml', {}) - xml_name = xml_desc.get('name', attr_desc['key']) + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) # Look for a children - is_iter_type = attr_desc['type'].startswith("[") + is_iter_type = attr_desc["type"].startswith("[") is_wrapped = xml_desc.get("wrapped", False) internal_type = attr_desc.get("internalType", None) internal_type_xml_map = getattr(internal_type, "_xml_map", {}) # Integrate namespace if necessary - xml_ns = xml_desc.get('ns', internal_type_xml_map.get("ns", None)) + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) if xml_ns: xml_name = "{}{}".format(xml_ns, xml_name) @@ -1294,15 +1280,15 @@ def xml_key_extractor(attr, attr_desc, data): # - Wrapped node # - Internal type is an enum (considered basic types) # - Internal type has no XML/Name node - if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or 'name' not in internal_type_xml_map)): + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): children = data.findall(xml_name) # If internal type has a local name and it's not a list, I use that name - elif not is_iter_type and internal_type and 'name' in internal_type_xml_map: + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: xml_name = _extract_name_from_internal_type(internal_type) children = data.findall(xml_name) # That's an array else: - if internal_type: # Complex type, ignore itemsName and use the complex type name + if internal_type: # Complex type, ignore itemsName and use the complex type name items_name = _extract_name_from_internal_type(internal_type) else: items_name = xml_desc.get("itemsName", xml_name) @@ -1311,21 +1297,22 @@ def xml_key_extractor(attr, attr_desc, data): if len(children) == 0: if is_iter_type: if is_wrapped: - return None # is_wrapped no node, we want None + return None # is_wrapped no node, we want None else: - return [] # not wrapped, assume empty list + return [] # not wrapped, assume empty list return None # Assume it's not there, maybe an optional node. # If is_iter_type and not wrapped, return all found children if is_iter_type: if not is_wrapped: return children - else: # Iter and wrapped, should have found one node only (the wrap one) + else: # Iter and wrapped, should have found one node only (the wrap one) if len(children) != 1: raise DeserializationError( "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( xml_name - )) + ) + ) return list(children[0]) # Might be empty list and that's ok. # Here it's not a itertype, we should have found one element only or empty @@ -1333,6 +1320,7 @@ def xml_key_extractor(attr, attr_desc, data): raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) return children[0] + class Deserializer(object): """Response object model deserializer. @@ -1340,37 +1328,32 @@ class Deserializer(object): :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. """ - basic_types = {str: 'str', int: 'int', bool: 'bool', float: 'float'} + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - valid_date = re.compile( - r'\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}' - r'\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?') + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") def __init__(self, classes=None): self.deserialize_type = { - 'iso-8601': Deserializer.deserialize_iso, - 'rfc-1123': Deserializer.deserialize_rfc, - 'unix-time': Deserializer.deserialize_unix, - 'duration': Deserializer.deserialize_duration, - 'date': Deserializer.deserialize_date, - 'time': Deserializer.deserialize_time, - 'decimal': Deserializer.deserialize_decimal, - 'long': Deserializer.deserialize_long, - 'bytearray': Deserializer.deserialize_bytearray, - 'base64': Deserializer.deserialize_base64, - 'object': self.deserialize_object, - '[]': self.deserialize_iter, - '{}': self.deserialize_dict - } + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } self.deserialize_expected_types = { - 'duration': (isodate.Duration, datetime.timedelta), - 'iso-8601': (datetime.datetime) + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), } self.dependencies = dict(classes) if classes else {} - self.key_extractors = [ - rest_key_extractor, - xml_key_extractor - ] + self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much # complicated, with no real scenario for now. @@ -1403,8 +1386,7 @@ def _deserialize(self, target_obj, data): """ # This is already a model, go recursive just in case if hasattr(data, "_attribute_map"): - constants = [name for name, config in getattr(data, '_validation', {}).items() - if config.get('constant')] + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] try: for attr, mapconfig in data._attribute_map.items(): if attr in constants: @@ -1412,15 +1394,11 @@ def _deserialize(self, target_obj, data): value = getattr(data, attr) if value is None: continue - local_type = mapconfig['type'] - internal_data_type = local_type.strip('[]{}') + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): continue - setattr( - data, - attr, - self._deserialize(local_type, value) - ) + setattr(data, attr, self._deserialize(local_type, value)) return data except AttributeError: return @@ -1435,16 +1413,16 @@ def _deserialize(self, target_obj, data): if data is None: return data try: - attributes = response._attribute_map + attributes = response._attribute_map # type: ignore d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... - if attr == "additional_properties" and attr_desc["key"] == '': + if attr == "additional_properties" and attr_desc["key"] == "": continue raw_value = None # Enhance attr_desc with some dynamic data - attr_desc = attr_desc.copy() # Do a copy, do not change the real one - internal_data_type = attr_desc["type"].strip('[]{}') + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") if internal_data_type in self.dependencies: attr_desc["internalType"] = self.dependencies[internal_data_type] @@ -1452,21 +1430,18 @@ def _deserialize(self, target_obj, data): found_value = key_extractor(attr, attr_desc, data) if found_value is not None: if raw_value is not None and raw_value != found_value: - msg = ("Ignoring extracted value '%s' from %s for key '%s'" - " (duplicate extraction, follow extractors order)" ) - _LOGGER.warning( - msg, - found_value, - key_extractor, - attr + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" ) + _LOGGER.warning(msg, found_value, key_extractor, attr) continue raw_value = found_value - value = self.deserialize_data(raw_value, attr_desc['type']) + value = self.deserialize_data(raw_value, attr_desc["type"]) d_attrs[attr] = value except (AttributeError, TypeError, KeyError) as err: - msg = "Unable to deserialize to object: " + class_name + msg = "Unable to deserialize to object: " + class_name # type: ignore raise_with_traceback(DeserializationError, msg, err) else: additional_properties = self._build_additional_properties(attributes, data) @@ -1475,14 +1450,17 @@ def _deserialize(self, target_obj, data): def _build_additional_properties(self, attribute_map, data): if not self.additional_properties_detection: return None - if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != '': + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": # Check empty string. If it's not empty, someone has a real "additionalProperties" return None if isinstance(data, ET.Element): data = {el.tag: el.text for el in data} - known_keys = {_decode_attribute_map_key(_FLATTEN.split(desc['key'])[0]) - for desc in attribute_map.values() if desc['key'] != ''} + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } present_keys = set(data.keys()) missing_keys = present_keys - known_keys return {key: data[key] for key in missing_keys} @@ -1525,8 +1503,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): return self(target_obj, data, content_type=content_type) except: _LOGGER.debug( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", - exc_info=True + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) return None @@ -1554,22 +1531,16 @@ def _unpack_content(raw_data, content_type=None): return context[RawDeserializer.CONTEXT_NAME] raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") - #Assume this is enough to recognize universal_http.ClientResponse without importing it + # Assume this is enough to recognize universal_http.ClientResponse without importing it if hasattr(raw_data, "body"): - return RawDeserializer.deserialize_from_http_generics( - raw_data.text(), - raw_data.headers - ) + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) # Assume this enough to recognize requests.Response without importing it. - if hasattr(raw_data, '_content_consumed'): - return RawDeserializer.deserialize_from_http_generics( - raw_data.text, - raw_data.headers - ) + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) - if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, 'read'): - return RawDeserializer.deserialize_from_text(raw_data, content_type) + if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore return raw_data def _instantiate_model(self, response, attrs, additional_properties=None): @@ -1579,14 +1550,11 @@ def _instantiate_model(self, response, attrs, additional_properties=None): :param d_attrs: The deserialized response attributes. """ if callable(response): - subtype = getattr(response, '_subtype_map', {}) + subtype = getattr(response, "_subtype_map", {}) try: - readonly = [k for k, v in response._validation.items() - if v.get('readonly')] - const = [k for k, v in response._validation.items() - if v.get('constant')] - kwargs = {k: v for k, v in attrs.items() - if k not in subtype and k not in readonly + const} + readonly = [k for k, v in response._validation.items() if v.get("readonly")] + const = [k for k, v in response._validation.items() if v.get("constant")] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) @@ -1594,8 +1562,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None): response_obj.additional_properties = additional_properties return response_obj except TypeError as err: - msg = "Unable to deserialize {} into model {}. ".format( - kwargs, response) + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore raise DeserializationError(msg + str(err)) else: try: @@ -1659,13 +1626,10 @@ def deserialize_iter(self, attr, iter_type): """ if attr is None: return None - if isinstance(attr, ET.Element): # If I receive an element here, get the children + if isinstance(attr, ET.Element): # If I receive an element here, get the children attr = list(attr) if not isinstance(attr, (list, set)): - raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format( - iter_type, - type(attr) - )) + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) return [self.deserialize_data(a, iter_type) for a in attr] def deserialize_dict(self, attr, dict_type): @@ -1677,7 +1641,7 @@ def deserialize_dict(self, attr, dict_type): :rtype: dict """ if isinstance(attr, list): - return {x['key']: self.deserialize_data(x['value'], dict_type) for x in attr} + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} if isinstance(attr, ET.Element): # Transform value into {"Key": "value"} @@ -1698,7 +1662,7 @@ def deserialize_object(self, attr, **kwargs): # Do no recurse on XML, just return the tree as-is return attr if isinstance(attr, basestring): - return self.deserialize_basic(attr, 'str') + return self.deserialize_basic(attr, "str") obj_type = type(attr) if obj_type in self.basic_types: return self.deserialize_basic(attr, self.basic_types[obj_type]) @@ -1709,8 +1673,7 @@ def deserialize_object(self, attr, **kwargs): deserialized = {} for key, value in attr.items(): try: - deserialized[key] = self.deserialize_object( - value, **kwargs) + deserialized[key] = self.deserialize_object(value, **kwargs) except ValueError: deserialized[key] = None return deserialized @@ -1719,8 +1682,7 @@ def deserialize_object(self, attr, **kwargs): deserialized = [] for obj in attr: try: - deserialized.append(self.deserialize_object( - obj, **kwargs)) + deserialized.append(self.deserialize_object(obj, **kwargs)) except ValueError: pass return deserialized @@ -1747,23 +1709,23 @@ def deserialize_basic(self, attr, data_type): if not attr: if data_type == "str": # None or '', node is empty string. - return '' + return "" else: # None or '', node with a strong type is None. # Don't try to model "empty bool" or "empty int" return None - if data_type == 'bool': + if data_type == "bool": if attr in [True, False, 1, 0]: return bool(attr) elif isinstance(attr, basestring): - if attr.lower() in ['true', '1']: + if attr.lower() in ["true", "1"]: return True - elif attr.lower() in ['false', '0']: + elif attr.lower() in ["false", "0"]: return False raise TypeError("Invalid boolean value: {}".format(attr)) - if data_type == 'str': + if data_type == "str": return self.deserialize_unicode(attr) return eval(data_type)(attr) # nosec @@ -1782,7 +1744,7 @@ def deserialize_unicode(data): # Consider this is real string try: - if isinstance(data, unicode): + if isinstance(data, unicode): # type: ignore return data except NameError: return str(data) @@ -1833,7 +1795,7 @@ def deserialize_bytearray(attr): """ if isinstance(attr, ET.Element): attr = attr.text - return bytearray(b64decode(attr)) + return bytearray(b64decode(attr)) # type: ignore @staticmethod def deserialize_base64(attr): @@ -1845,9 +1807,9 @@ def deserialize_base64(attr): """ if isinstance(attr, ET.Element): attr = attr.text - padding = '=' * (3 - (len(attr) + 3) % 4) - attr = attr + padding - encoded = attr.replace('-', '+').replace('_', '/') + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") return b64decode(encoded) @staticmethod @@ -1861,7 +1823,7 @@ def deserialize_decimal(attr): if isinstance(attr, ET.Element): attr = attr.text try: - return decimal.Decimal(attr) + return decimal.Decimal(attr) # type: ignore except decimal.DecimalException as err: msg = "Invalid decimal {}".format(attr) raise_with_traceback(DeserializationError, msg, err) @@ -1876,7 +1838,7 @@ def deserialize_long(attr): """ if isinstance(attr, ET.Element): attr = attr.text - return _long_type(attr) + return _long_type(attr) # type: ignore @staticmethod def deserialize_duration(attr): @@ -1890,7 +1852,7 @@ def deserialize_duration(attr): attr = attr.text try: duration = isodate.parse_duration(attr) - except(ValueError, OverflowError, AttributeError) as err: + except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." raise_with_traceback(DeserializationError, msg, err) else: @@ -1906,7 +1868,7 @@ def deserialize_date(attr): """ if isinstance(attr, ET.Element): attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. return isodate.parse_date(attr, defaultmonth=None, defaultday=None) @@ -1921,7 +1883,7 @@ def deserialize_time(attr): """ if isinstance(attr, ET.Element): attr = attr.text - if re.search(r"[^\W\d_]", attr, re.I + re.U): + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) return isodate.parse_time(attr) @@ -1936,10 +1898,9 @@ def deserialize_rfc(attr): if isinstance(attr, ET.Element): attr = attr.text try: - parsed_date = email.utils.parsedate_tz(attr) + parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( - *parsed_date[:6], - tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0)/60)) + *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) if not date_obj.tzinfo: date_obj = date_obj.astimezone(tz=TZ_UTC) @@ -1960,12 +1921,12 @@ def deserialize_iso(attr): if isinstance(attr, ET.Element): attr = attr.text try: - attr = attr.upper() + attr = attr.upper() # type: ignore match = Deserializer.valid_date.match(attr) if not match: raise ValueError("Invalid datetime string: " + attr) - check_decimal = attr.split('.') + check_decimal = attr.split(".") if len(check_decimal) > 1: decimal_str = "" for digit in check_decimal[1]: @@ -1980,7 +1941,7 @@ def deserialize_iso(attr): test_utc = date_obj.utctimetuple() if test_utc.tm_year > 9999 or test_utc.tm_year < 1: raise OverflowError("Hit max or min date") - except(ValueError, OverflowError, AttributeError) as err: + except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." raise_with_traceback(DeserializationError, msg, err) else: @@ -1996,7 +1957,7 @@ def deserialize_unix(attr): :raises: DeserializationError if format invalid """ if isinstance(attr, ET.Element): - attr = int(attr.text) + attr = int(attr.text) # type: ignore try: date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) except ValueError as err: diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_configuration.py index 1e7bb939778c..f085bcc1fe5d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_configuration.py @@ -36,7 +36,7 @@ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - **kwargs # type: Any + **kwargs: Any ) -> None: if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_security_center.py index 88bde0dbc421..156626ee61a1 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_security_center.py @@ -87,6 +87,9 @@ class SecurityCenter(MultiApiClientMixin, _SDKClient): 'iot_security_solutions_analytics_recommendation': '2019-08-01', 'jit_network_access_policies': '2020-01-01', 'locations': '2015-06-01-preview', + 'management_group_governance_rule': '2022-01-01-preview', + 'management_group_governance_rules': '2022-01-01-preview', + 'management_group_governance_rules_operation_result': '2022-01-01-preview', 'mde_onboardings': '2021-10-01-preview', 'operations': '2015-06-01-preview', 'pricings': '2022-03-01', @@ -98,7 +101,7 @@ class SecurityCenter(MultiApiClientMixin, _SDKClient): 'secure_scores': '2020-01-01', 'security_connector_governance_rule': '2022-01-01-preview', 'security_connector_governance_rules': '2022-01-01-preview', - 'security_connector_governance_rules_execute_status': '2022-01-01-preview', + 'security_connector_governance_rules_operation_result': '2022-01-01-preview', 'security_contacts': '2017-08-01-preview', 'security_solutions': '2020-01-01', 'security_solutions_reference_data': '2020-01-01', @@ -108,7 +111,7 @@ class SecurityCenter(MultiApiClientMixin, _SDKClient): 'sql_vulnerability_assessment_scan_results': '2020-07-01-preview', 'sql_vulnerability_assessment_scans': '2020-07-01-preview', 'sub_assessments': '2019-01-01-preview', - 'subscription_governance_rules_execute_status': '2022-01-01-preview', + 'subscription_governance_rules_operation_result': '2022-01-01-preview', 'tasks': '2015-06-01-preview', 'topology': '2020-01-01', 'workspace_settings': '2017-08-01-preview', @@ -123,7 +126,7 @@ def __init__( api_version: Optional[str] = None, base_url: str = "https://management.azure.com", profile: KnownProfiles = KnownProfiles.default, - **kwargs # type: Any + **kwargs: Any ) -> None: self._config = SecurityCenterConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) @@ -682,6 +685,48 @@ def locations(self): self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def management_group_governance_rule(self): + """Instance depends on the API version: + + * 2022-01-01-preview: :class:`ManagementGroupGovernanceRuleOperations` + """ + api_version = self._get_api_version('management_group_governance_rule') + if api_version == '2022-01-01-preview': + from ..v2022_01_01_preview.aio.operations import ManagementGroupGovernanceRuleOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'management_group_governance_rule'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def management_group_governance_rules(self): + """Instance depends on the API version: + + * 2022-01-01-preview: :class:`ManagementGroupGovernanceRulesOperations` + """ + api_version = self._get_api_version('management_group_governance_rules') + if api_version == '2022-01-01-preview': + from ..v2022_01_01_preview.aio.operations import ManagementGroupGovernanceRulesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'management_group_governance_rules'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def management_group_governance_rules_operation_result(self): + """Instance depends on the API version: + + * 2022-01-01-preview: :class:`ManagementGroupGovernanceRulesOperationResultOperations` + """ + api_version = self._get_api_version('management_group_governance_rules_operation_result') + if api_version == '2022-01-01-preview': + from ..v2022_01_01_preview.aio.operations import ManagementGroupGovernanceRulesOperationResultOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'management_group_governance_rules_operation_result'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def mde_onboardings(self): """Instance depends on the API version: @@ -868,16 +913,16 @@ def security_connector_governance_rules(self): return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property - def security_connector_governance_rules_execute_status(self): + def security_connector_governance_rules_operation_result(self): """Instance depends on the API version: - * 2022-01-01-preview: :class:`SecurityConnectorGovernanceRulesExecuteStatusOperations` + * 2022-01-01-preview: :class:`SecurityConnectorGovernanceRulesOperationResultOperations` """ - api_version = self._get_api_version('security_connector_governance_rules_execute_status') + api_version = self._get_api_version('security_connector_governance_rules_operation_result') if api_version == '2022-01-01-preview': - from ..v2022_01_01_preview.aio.operations import SecurityConnectorGovernanceRulesExecuteStatusOperations as OperationClass + from ..v2022_01_01_preview.aio.operations import SecurityConnectorGovernanceRulesOperationResultOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'security_connector_governance_rules_execute_status'".format(api_version)) + raise ValueError("API version {} does not have operation group 'security_connector_governance_rules_operation_result'".format(api_version)) self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1048,16 +1093,16 @@ def sub_assessments(self): return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property - def subscription_governance_rules_execute_status(self): + def subscription_governance_rules_operation_result(self): """Instance depends on the API version: - * 2022-01-01-preview: :class:`SubscriptionGovernanceRulesExecuteStatusOperations` + * 2022-01-01-preview: :class:`SubscriptionGovernanceRulesOperationResultOperations` """ - api_version = self._get_api_version('subscription_governance_rules_execute_status') + api_version = self._get_api_version('subscription_governance_rules_operation_result') if api_version == '2022-01-01-preview': - from ..v2022_01_01_preview.aio.operations import SubscriptionGovernanceRulesExecuteStatusOperations as OperationClass + from ..v2022_01_01_preview.aio.operations import SubscriptionGovernanceRulesOperationResultOperations as OperationClass else: - raise ValueError("API version {} does not have operation group 'subscription_governance_rules_execute_status'".format(api_version)) + raise ValueError("API version {} does not have operation group 'subscription_governance_rules_operation_result'".format(api_version)) self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_configuration.py index c5a559682c88..9b461ff85596 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2015-06-01-preview") # type: Literal["2015-06-01-preview"] + api_version: Literal["2015-06-01-preview"] = kwargs.pop("api_version", "2015-06-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_metadata.json index 251d12e3010f..405d14a694ee 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_security_center.py index ac8a0bbd061b..53ec6e758519 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import LocationsOperations, Operations, TasksOperations @@ -52,7 +52,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -82,15 +82,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/_configuration.py index acdf00c88a84..bce3cb945a73 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2015-06-01-preview") # type: Literal["2015-06-01-preview"] + api_version: Literal["2015-06-01-preview"] = kwargs.pop("api_version", "2015-06-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/_security_center.py index f2384c2be350..88c01dc39e34 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import LocationsOperations, Operations, TasksOperations @@ -52,7 +52,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/__init__.py index 85fff64e04d6..8e1c2e52e196 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/__init__.py @@ -11,7 +11,7 @@ from ._tasks_operations import TasksOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/_locations_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/_locations_operations.py index 8192e2fba9ae..e15ffc68efa5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/_locations_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/_locations_operations.py @@ -73,10 +73,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.AscLocation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AscLocationList] + ) + cls: ClsType[_models.AscLocationList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -97,7 +97,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -113,7 +113,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -121,13 +121,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AscLocationList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -140,7 +140,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations"} @distributed_trace_async async def get(self, asc_location: str, **kwargs: Any) -> _models.AscLocation: @@ -165,10 +165,10 @@ async def get(self, asc_location: str, **kwargs: Any) -> _models.AscLocation: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AscLocation] + ) + cls: ClsType[_models.AscLocation] = kwargs.pop("cls", None) request = build_get_request( asc_location=asc_location, @@ -179,9 +179,9 @@ async def get(self, asc_location: str, **kwargs: Any) -> _models.AscLocation: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -198,4 +198,4 @@ async def get(self, asc_location: str, **kwargs: Any) -> _models.AscLocation: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/_operations.py index 29ad792ed595..58597ddf56a5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/_operations.py @@ -70,10 +70,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + ) + cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -93,7 +93,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -109,7 +109,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -117,13 +117,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -136,4 +136,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.Security/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Security/operations"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/_tasks_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/_tasks_operations.py index b29058c24837..c70a4822519c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/_tasks_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/aio/operations/_tasks_operations.py @@ -81,10 +81,10 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> AsyncIterable["_m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityTaskList] + ) + cls: ClsType[_models.SecurityTaskList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -106,7 +106,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -122,7 +122,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -130,13 +130,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityTaskList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -149,7 +149,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/tasks"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/tasks"} @distributed_trace def list_by_home_region( @@ -171,10 +171,10 @@ def list_by_home_region( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityTaskList] + ) + cls: ClsType[_models.SecurityTaskList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -197,7 +197,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -213,7 +213,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -221,13 +221,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityTaskList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -240,7 +240,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_home_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks"} # type: ignore + list_by_home_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks" + } @distributed_trace_async async def get_subscription_level_task( @@ -269,10 +271,10 @@ async def get_subscription_level_task( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityTask] + ) + cls: ClsType[_models.SecurityTask] = kwargs.pop("cls", None) request = build_get_subscription_level_task_request( asc_location=asc_location, @@ -284,9 +286,9 @@ async def get_subscription_level_task( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -303,7 +305,9 @@ async def get_subscription_level_task( return deserialized - get_subscription_level_task.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}"} # type: ignore + get_subscription_level_task.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}" + } @distributed_trace_async async def update_subscription_level_task_state( # pylint: disable=inconsistent-return-statements @@ -340,10 +344,10 @@ async def update_subscription_level_task_state( # pylint: disable=inconsistent- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_subscription_level_task_state_request( asc_location=asc_location, @@ -356,9 +360,9 @@ async def update_subscription_level_task_state( # pylint: disable=inconsistent- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -371,7 +375,9 @@ async def update_subscription_level_task_state( # pylint: disable=inconsistent- if cls: return cls(pipeline_response, None, {}) - update_subscription_level_task_state.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}"} # type: ignore + update_subscription_level_task_state.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}" + } @distributed_trace def list_by_resource_group( @@ -396,10 +402,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityTaskList] + ) + cls: ClsType[_models.SecurityTaskList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -423,7 +429,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -439,7 +445,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -447,13 +453,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityTaskList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -466,7 +472,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks" + } @distributed_trace_async async def get_resource_group_level_task( @@ -498,10 +506,10 @@ async def get_resource_group_level_task( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityTask] + ) + cls: ClsType[_models.SecurityTask] = kwargs.pop("cls", None) request = build_get_resource_group_level_task_request( resource_group_name=resource_group_name, @@ -514,9 +522,9 @@ async def get_resource_group_level_task( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -533,7 +541,9 @@ async def get_resource_group_level_task( return deserialized - get_resource_group_level_task.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}"} # type: ignore + get_resource_group_level_task.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}" + } @distributed_trace_async async def update_resource_group_level_task_state( # pylint: disable=inconsistent-return-statements @@ -574,10 +584,10 @@ async def update_resource_group_level_task_state( # pylint: disable=inconsisten _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_resource_group_level_task_state_request( resource_group_name=resource_group_name, @@ -591,9 +601,9 @@ async def update_resource_group_level_task_state( # pylint: disable=inconsisten params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -606,4 +616,6 @@ async def update_resource_group_level_task_state( # pylint: disable=inconsisten if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_task_state.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}"} # type: ignore + update_resource_group_level_task_state.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/models/__init__.py index b37bdd7f8291..66eeb1a94bdd 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/models/__init__.py @@ -20,7 +20,7 @@ from ._security_center_enums import TaskUpdateActionType from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/__init__.py index 85fff64e04d6..8e1c2e52e196 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/__init__.py @@ -11,7 +11,7 @@ from ._tasks_operations import TasksOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/_locations_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/_locations_operations.py index a6ae0bc51282..9d9391357360 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/_locations_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/_locations_operations.py @@ -45,9 +45,9 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,9 +73,9 @@ def build_get_request(asc_location: str, subscription_id: str, **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +89,7 @@ def build_get_request(asc_location: str, subscription_id: str, **kwargs: Any) -> "ascLocation": _SERIALIZER.url("asc_location", asc_location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -134,10 +134,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.AscLocation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AscLocationList] + ) + cls: ClsType[_models.AscLocationList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -158,7 +158,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -174,7 +174,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -182,13 +182,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AscLocationList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -201,7 +201,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations"} @distributed_trace def get(self, asc_location: str, **kwargs: Any) -> _models.AscLocation: @@ -226,10 +226,10 @@ def get(self, asc_location: str, **kwargs: Any) -> _models.AscLocation: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AscLocation] + ) + cls: ClsType[_models.AscLocation] = kwargs.pop("cls", None) request = build_get_request( asc_location=asc_location, @@ -240,9 +240,9 @@ def get(self, asc_location: str, **kwargs: Any) -> _models.AscLocation: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -259,4 +259,4 @@ def get(self, asc_location: str, **kwargs: Any) -> _models.AscLocation: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/_operations.py index 49b52920f5cf..1a99a755c7b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/_operations.py @@ -45,9 +45,9 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,10 +93,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationList] + ) + cls: ClsType[_models.OperationList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -116,7 +116,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -132,7 +132,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -140,13 +140,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("OperationList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -159,4 +159,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.Security/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Security/operations"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/_tasks_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/_tasks_operations.py index bd53fab9ae24..68b2b57bcb57 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/_tasks_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/_tasks_operations.py @@ -45,9 +45,9 @@ def build_list_request(subscription_id: str, *, filter: Optional[str] = None, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, *, filter: Optional[str] = None, ** ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -77,9 +77,9 @@ def build_list_by_home_region_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,7 +93,7 @@ def build_list_by_home_region_request( "ascLocation": _SERIALIZER.url("asc_location", asc_location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -112,9 +112,9 @@ def build_get_subscription_level_task_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -130,7 +130,7 @@ def build_get_subscription_level_task_request( "taskName": _SERIALIZER.url("task_name", task_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,9 +151,9 @@ def build_update_subscription_level_task_state_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -170,7 +170,7 @@ def build_update_subscription_level_task_state_request( "taskUpdateActionType": _SERIALIZER.url("task_update_action_type", task_update_action_type, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -187,9 +187,9 @@ def build_list_by_resource_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +207,7 @@ def build_list_by_resource_group_request( "ascLocation": _SERIALIZER.url("asc_location", asc_location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -226,9 +226,9 @@ def build_get_resource_group_level_task_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -247,7 +247,7 @@ def build_get_resource_group_level_task_request( "taskName": _SERIALIZER.url("task_name", task_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -269,9 +269,9 @@ def build_update_resource_group_level_task_state_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -291,7 +291,7 @@ def build_update_resource_group_level_task_state_request( "taskUpdateActionType": _SERIALIZER.url("task_update_action_type", task_update_action_type, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -336,10 +336,10 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityTaskList] + ) + cls: ClsType[_models.SecurityTaskList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -361,7 +361,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -377,7 +377,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -385,13 +385,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityTaskList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -404,7 +404,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/tasks"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/tasks"} @distributed_trace def list_by_home_region( @@ -426,10 +426,10 @@ def list_by_home_region( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityTaskList] + ) + cls: ClsType[_models.SecurityTaskList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -452,7 +452,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -468,7 +468,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -476,13 +476,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityTaskList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -495,7 +495,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_home_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks"} # type: ignore + list_by_home_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks" + } @distributed_trace def get_subscription_level_task(self, asc_location: str, task_name: str, **kwargs: Any) -> _models.SecurityTask: @@ -522,10 +524,10 @@ def get_subscription_level_task(self, asc_location: str, task_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityTask] + ) + cls: ClsType[_models.SecurityTask] = kwargs.pop("cls", None) request = build_get_subscription_level_task_request( asc_location=asc_location, @@ -537,9 +539,9 @@ def get_subscription_level_task(self, asc_location: str, task_name: str, **kwarg params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -556,7 +558,9 @@ def get_subscription_level_task(self, asc_location: str, task_name: str, **kwarg return deserialized - get_subscription_level_task.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}"} # type: ignore + get_subscription_level_task.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}" + } @distributed_trace def update_subscription_level_task_state( # pylint: disable=inconsistent-return-statements @@ -593,10 +597,10 @@ def update_subscription_level_task_state( # pylint: disable=inconsistent-return _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_subscription_level_task_state_request( asc_location=asc_location, @@ -609,9 +613,9 @@ def update_subscription_level_task_state( # pylint: disable=inconsistent-return params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -624,7 +628,9 @@ def update_subscription_level_task_state( # pylint: disable=inconsistent-return if cls: return cls(pipeline_response, None, {}) - update_subscription_level_task_state.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}"} # type: ignore + update_subscription_level_task_state.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}" + } @distributed_trace def list_by_resource_group( @@ -649,10 +655,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityTaskList] + ) + cls: ClsType[_models.SecurityTaskList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -676,7 +682,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -692,7 +698,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -700,13 +706,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityTaskList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -719,7 +725,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks" + } @distributed_trace def get_resource_group_level_task( @@ -751,10 +759,10 @@ def get_resource_group_level_task( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityTask] + ) + cls: ClsType[_models.SecurityTask] = kwargs.pop("cls", None) request = build_get_resource_group_level_task_request( resource_group_name=resource_group_name, @@ -767,9 +775,9 @@ def get_resource_group_level_task( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -786,7 +794,9 @@ def get_resource_group_level_task( return deserialized - get_resource_group_level_task.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}"} # type: ignore + get_resource_group_level_task.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}" + } @distributed_trace def update_resource_group_level_task_state( # pylint: disable=inconsistent-return-statements @@ -827,10 +837,10 @@ def update_resource_group_level_task_state( # pylint: disable=inconsistent-retu _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2015-06-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2015-06-01-preview") - ) # type: Literal["2015-06-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_resource_group_level_task_state_request( resource_group_name=resource_group_name, @@ -844,9 +854,9 @@ def update_resource_group_level_task_state( # pylint: disable=inconsistent-retu params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -859,4 +869,6 @@ def update_resource_group_level_task_state( # pylint: disable=inconsistent-retu if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_task_state.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}"} # type: ignore + update_resource_group_level_task_state.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_configuration.py index 7c2f0329f3c1..9bf93a6f2872 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_configuration.py @@ -40,7 +40,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2017-08-01") # type: Literal["2017-08-01"] + api_version: Literal["2017-08-01"] = kwargs.pop("api_version", "2017-08-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,10 +51,7 @@ def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None: kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_metadata.json index a3d9e73ca6f8..af70a78617a4 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_metadata.json @@ -36,7 +36,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -48,7 +48,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_security_center.py index 018a0d49e1c4..2b5b5e334495 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ComplianceResultsOperations @@ -43,7 +43,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -73,15 +73,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/_configuration.py index a9eb28389fa5..df97c25cd544 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/_configuration.py @@ -40,7 +40,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2017-08-01") # type: Literal["2017-08-01"] + api_version: Literal["2017-08-01"] = kwargs.pop("api_version", "2017-08-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/_security_center.py index 2f640b6ea119..a7d387df1246 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ComplianceResultsOperations @@ -43,7 +43,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/operations/__init__.py index 05cc3fb3f4a0..7cfcb2ac627d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/operations/__init__.py @@ -9,7 +9,7 @@ from ._compliance_results_operations import ComplianceResultsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/operations/_compliance_results_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/operations/_compliance_results_operations.py index 0c69edc315df..9932b6aded1c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/operations/_compliance_results_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/aio/operations/_compliance_results_operations.py @@ -75,8 +75,8 @@ def list(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.ComplianceRe _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-08-01")) # type: Literal["2017-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ComplianceResultList] + api_version: Literal["2017-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2017-08-01")) + cls: ClsType[_models.ComplianceResultList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -97,7 +97,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -113,7 +113,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -121,13 +121,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ComplianceResultList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -140,7 +140,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Security/complianceResults"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Security/complianceResults"} @distributed_trace_async async def get(self, resource_id: str, compliance_result_name: str, **kwargs: Any) -> _models.ComplianceResult: @@ -166,8 +166,8 @@ async def get(self, resource_id: str, compliance_result_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-08-01")) # type: Literal["2017-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ComplianceResult] + api_version: Literal["2017-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2017-08-01")) + cls: ClsType[_models.ComplianceResult] = kwargs.pop("cls", None) request = build_get_request( resource_id=resource_id, @@ -178,9 +178,9 @@ async def get(self, resource_id: str, compliance_result_name: str, **kwargs: Any params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -197,4 +197,4 @@ async def get(self, resource_id: str, compliance_result_name: str, **kwargs: Any return deserialized - get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName}"} # type: ignore + get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/models/__init__.py index 6cae848e2e56..1303df6fb8f4 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/models/__init__.py @@ -14,7 +14,7 @@ from ._security_center_enums import ResourceStatus from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/operations/__init__.py index 05cc3fb3f4a0..7cfcb2ac627d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/operations/__init__.py @@ -9,7 +9,7 @@ from ._compliance_results_operations import ComplianceResultsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/operations/_compliance_results_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/operations/_compliance_results_operations.py index b62b7604b5c2..2b0aa1bd0821 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/operations/_compliance_results_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/operations/_compliance_results_operations.py @@ -45,7 +45,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-08-01")) # type: Literal["2017-08-01"] + api_version: Literal["2017-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2017-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,7 +54,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -69,7 +69,7 @@ def build_get_request(resource_id: str, compliance_result_name: str, **kwargs: A _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-08-01")) # type: Literal["2017-08-01"] + api_version: Literal["2017-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2017-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +81,7 @@ def build_get_request(resource_id: str, compliance_result_name: str, **kwargs: A "complianceResultName": _SERIALIZER.url("compliance_result_name", compliance_result_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -127,8 +127,8 @@ def list(self, scope: str, **kwargs: Any) -> Iterable["_models.ComplianceResult" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-08-01")) # type: Literal["2017-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ComplianceResultList] + api_version: Literal["2017-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2017-08-01")) + cls: ClsType[_models.ComplianceResultList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -149,7 +149,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -165,7 +165,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -173,13 +173,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ComplianceResultList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -192,7 +192,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Security/complianceResults"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Security/complianceResults"} @distributed_trace def get(self, resource_id: str, compliance_result_name: str, **kwargs: Any) -> _models.ComplianceResult: @@ -218,8 +218,8 @@ def get(self, resource_id: str, compliance_result_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-08-01")) # type: Literal["2017-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ComplianceResult] + api_version: Literal["2017-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2017-08-01")) + cls: ClsType[_models.ComplianceResult] = kwargs.pop("cls", None) request = build_get_request( resource_id=resource_id, @@ -230,9 +230,9 @@ def get(self, resource_id: str, compliance_result_name: str, **kwargs: Any) -> _ params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -249,4 +249,4 @@ def get(self, resource_id: str, compliance_result_name: str, **kwargs: Any) -> _ return deserialized - get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName}"} # type: ignore + get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_configuration.py index 93d7fbe4adcb..46fd8eba8b0e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2017-08-01-preview") # type: Literal["2017-08-01-preview"] + api_version: Literal["2017-08-01-preview"] = kwargs.pop("api_version", "2017-08-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_metadata.json index b1b962d4083c..73f1b8c1f7bf 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_security_center.py index d08c19685330..62f7262ee1cd 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ( @@ -66,7 +66,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -106,15 +106,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/_configuration.py index 00d25b5afc26..e6b9dee820a5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2017-08-01-preview") # type: Literal["2017-08-01-preview"] + api_version: Literal["2017-08-01-preview"] = kwargs.pop("api_version", "2017-08-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/_security_center.py index 65faa86f575d..34c0b101f5da 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ( @@ -67,7 +67,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/__init__.py index 44edabecfaab..a09258020a82 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/__init__.py @@ -13,7 +13,7 @@ from ._workspace_settings_operations import WorkspaceSettingsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_auto_provisioning_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_auto_provisioning_settings_operations.py index 3550d9f4a2b4..31cebb493817 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_auto_provisioning_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_auto_provisioning_settings_operations.py @@ -76,10 +76,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.AutoProvisioningSetting" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AutoProvisioningSettingList] + ) + cls: ClsType[_models.AutoProvisioningSettingList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -100,7 +100,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -116,7 +116,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -124,13 +124,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AutoProvisioningSettingList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -143,7 +143,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings"} @distributed_trace_async async def get(self, setting_name: str, **kwargs: Any) -> _models.AutoProvisioningSetting: @@ -167,10 +167,10 @@ async def get(self, setting_name: str, **kwargs: Any) -> _models.AutoProvisionin _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AutoProvisioningSetting] + ) + cls: ClsType[_models.AutoProvisioningSetting] = kwargs.pop("cls", None) request = build_get_request( setting_name=setting_name, @@ -181,9 +181,9 @@ async def get(self, setting_name: str, **kwargs: Any) -> _models.AutoProvisionin params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -200,7 +200,9 @@ async def get(self, setting_name: str, **kwargs: Any) -> _models.AutoProvisionin return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}" + } @overload async def create( @@ -274,11 +276,11 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AutoProvisioningSetting] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutoProvisioningSetting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -300,9 +302,9 @@ async def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -319,4 +321,6 @@ async def create( return deserialized - create.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}"} # type: ignore + create.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_compliances_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_compliances_operations.py index 461dcaad1f17..69bf49d94075 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_compliances_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_compliances_operations.py @@ -75,10 +75,10 @@ def list(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.Compliance"] _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ComplianceList] + ) + cls: ClsType[_models.ComplianceList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -99,7 +99,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -115,7 +115,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -123,13 +123,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ComplianceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -142,7 +142,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Security/compliances"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Security/compliances"} @distributed_trace_async async def get(self, scope: str, compliance_name: str, **kwargs: Any) -> _models.Compliance: @@ -170,10 +170,10 @@ async def get(self, scope: str, compliance_name: str, **kwargs: Any) -> _models. _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Compliance] + ) + cls: ClsType[_models.Compliance] = kwargs.pop("cls", None) request = build_get_request( scope=scope, @@ -184,9 +184,9 @@ async def get(self, scope: str, compliance_name: str, **kwargs: Any) -> _models. params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -203,4 +203,4 @@ async def get(self, scope: str, compliance_name: str, **kwargs: Any) -> _models. return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.Security/compliances/{complianceName}"} # type: ignore + get.metadata = {"url": "/{scope}/providers/Microsoft.Security/compliances/{complianceName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_information_protection_policies_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_information_protection_policies_operations.py index 089089b739d3..efbb552c87c4 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_information_protection_policies_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_information_protection_policies_operations.py @@ -95,10 +95,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InformationProtectionPolicy] + ) + cls: ClsType[_models.InformationProtectionPolicy] = kwargs.pop("cls", None) request = build_get_request( scope=scope, @@ -109,9 +109,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -128,7 +128,9 @@ async def get( return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}"} # type: ignore + get.metadata = { + "url": "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}" + } @overload async def create_or_update( @@ -234,11 +236,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InformationProtectionPolicy] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InformationProtectionPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -260,9 +262,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -279,11 +281,13 @@ async def create_or_update( deserialized = self._deserialize("InformationProtectionPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}" + } @distributed_trace def list(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.InformationProtectionPolicy"]: @@ -303,10 +307,10 @@ def list(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.InformationP _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InformationProtectionPolicyList] + ) + cls: ClsType[_models.InformationProtectionPolicyList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -327,7 +331,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -343,7 +347,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -351,13 +355,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("InformationProtectionPolicyList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -370,4 +374,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Security/informationProtectionPolicies"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Security/informationProtectionPolicies"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_security_contacts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_security_contacts_operations.py index 3c4645fac8a9..a86822af1e52 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_security_contacts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_security_contacts_operations.py @@ -77,10 +77,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.SecurityContact"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityContactList] + ) + cls: ClsType[_models.SecurityContactList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -101,7 +101,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -117,7 +117,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -125,13 +125,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityContactList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -144,7 +144,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts"} @distributed_trace_async async def get(self, security_contact_name: str, **kwargs: Any) -> _models.SecurityContact: @@ -168,10 +168,10 @@ async def get(self, security_contact_name: str, **kwargs: Any) -> _models.Securi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityContact] + ) + cls: ClsType[_models.SecurityContact] = kwargs.pop("cls", None) request = build_get_request( security_contact_name=security_contact_name, @@ -182,9 +182,9 @@ async def get(self, security_contact_name: str, **kwargs: Any) -> _models.Securi params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -201,7 +201,9 @@ async def get(self, security_contact_name: str, **kwargs: Any) -> _models.Securi return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}" + } @overload async def create( @@ -276,11 +278,11 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityContact] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityContact] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -302,9 +304,9 @@ async def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -321,7 +323,9 @@ async def create( return deserialized - create.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}"} # type: ignore + create.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -347,10 +351,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( security_contact_name=security_contact_name, @@ -361,9 +365,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -376,7 +380,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}" + } @overload async def update( @@ -451,11 +457,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityContact] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityContact] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -477,9 +483,9 @@ async def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -496,4 +502,6 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_workspace_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_workspace_settings_operations.py index 3aadca5bb094..35b568134f29 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_workspace_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/aio/operations/_workspace_settings_operations.py @@ -78,10 +78,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.WorkspaceSetting"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkspaceSettingList] + ) + cls: ClsType[_models.WorkspaceSettingList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -102,7 +102,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -118,7 +118,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -126,13 +126,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("WorkspaceSettingList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -145,7 +145,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings"} @distributed_trace_async async def get(self, workspace_setting_name: str, **kwargs: Any) -> _models.WorkspaceSetting: @@ -170,10 +170,10 @@ async def get(self, workspace_setting_name: str, **kwargs: Any) -> _models.Works _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkspaceSetting] + ) + cls: ClsType[_models.WorkspaceSetting] = kwargs.pop("cls", None) request = build_get_request( workspace_setting_name=workspace_setting_name, @@ -184,9 +184,9 @@ async def get(self, workspace_setting_name: str, **kwargs: Any) -> _models.Works params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -203,7 +203,9 @@ async def get(self, workspace_setting_name: str, **kwargs: Any) -> _models.Works return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}" + } @overload async def create( @@ -283,11 +285,11 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkspaceSetting] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WorkspaceSetting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -309,9 +311,9 @@ async def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -328,7 +330,9 @@ async def create( return deserialized - create.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}"} # type: ignore + create.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}" + } @overload async def update( @@ -408,11 +412,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkspaceSetting] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WorkspaceSetting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -434,9 +438,9 @@ async def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -453,7 +457,9 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -480,10 +486,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( workspace_setting_name=workspace_setting_name, @@ -494,9 +500,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -509,4 +515,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/models/__init__.py index 244166e9bdfb..d832d981d78d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/models/__init__.py @@ -30,7 +30,7 @@ from ._security_center_enums import InformationProtectionPolicyName from ._security_center_enums import Rank from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/__init__.py index 44edabecfaab..a09258020a82 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/__init__.py @@ -13,7 +13,7 @@ from ._workspace_settings_operations import WorkspaceSettingsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_auto_provisioning_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_auto_provisioning_settings_operations.py index c4caaaa8c4ca..6a60cb8a86fa 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_auto_provisioning_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_auto_provisioning_settings_operations.py @@ -45,9 +45,9 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -75,9 +75,9 @@ def build_get_request(setting_name: str, subscription_id: str, **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_get_request(setting_name: str, subscription_id: str, **kwargs: Any) -> "settingName": _SERIALIZER.url("setting_name", setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,10 +107,10 @@ def build_create_request(setting_name: str, subscription_id: str, **kwargs: Any) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,7 +125,7 @@ def build_create_request(setting_name: str, subscription_id: str, **kwargs: Any) "settingName": _SERIALIZER.url("setting_name", setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -171,10 +171,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.AutoProvisioningSetting"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AutoProvisioningSettingList] + ) + cls: ClsType[_models.AutoProvisioningSettingList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -195,7 +195,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -211,7 +211,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -219,13 +219,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AutoProvisioningSettingList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -238,7 +238,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings"} @distributed_trace def get(self, setting_name: str, **kwargs: Any) -> _models.AutoProvisioningSetting: @@ -262,10 +262,10 @@ def get(self, setting_name: str, **kwargs: Any) -> _models.AutoProvisioningSetti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AutoProvisioningSetting] + ) + cls: ClsType[_models.AutoProvisioningSetting] = kwargs.pop("cls", None) request = build_get_request( setting_name=setting_name, @@ -276,9 +276,9 @@ def get(self, setting_name: str, **kwargs: Any) -> _models.AutoProvisioningSetti params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -295,7 +295,9 @@ def get(self, setting_name: str, **kwargs: Any) -> _models.AutoProvisioningSetti return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}" + } @overload def create( @@ -369,11 +371,11 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AutoProvisioningSetting] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutoProvisioningSetting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -395,9 +397,9 @@ def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -414,4 +416,6 @@ def create( return deserialized - create.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}"} # type: ignore + create.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_compliances_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_compliances_operations.py index d29f85ec3a43..2eaed77478d7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_compliances_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_compliances_operations.py @@ -45,9 +45,9 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -71,9 +71,9 @@ def build_get_request(scope: str, compliance_name: str, **kwargs: Any) -> HttpRe _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +83,7 @@ def build_get_request(scope: str, compliance_name: str, **kwargs: Any) -> HttpRe "complianceName": _SERIALIZER.url("compliance_name", compliance_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -130,10 +130,10 @@ def list(self, scope: str, **kwargs: Any) -> Iterable["_models.Compliance"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ComplianceList] + ) + cls: ClsType[_models.ComplianceList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -154,7 +154,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -170,7 +170,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -178,13 +178,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ComplianceList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -197,7 +197,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Security/compliances"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Security/compliances"} @distributed_trace def get(self, scope: str, compliance_name: str, **kwargs: Any) -> _models.Compliance: @@ -225,10 +225,10 @@ def get(self, scope: str, compliance_name: str, **kwargs: Any) -> _models.Compli _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Compliance] + ) + cls: ClsType[_models.Compliance] = kwargs.pop("cls", None) request = build_get_request( scope=scope, @@ -239,9 +239,9 @@ def get(self, scope: str, compliance_name: str, **kwargs: Any) -> _models.Compli params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -258,4 +258,4 @@ def get(self, scope: str, compliance_name: str, **kwargs: Any) -> _models.Compli return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.Security/compliances/{complianceName}"} # type: ignore + get.metadata = {"url": "/{scope}/providers/Microsoft.Security/compliances/{complianceName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_information_protection_policies_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_information_protection_policies_operations.py index 63720c65bf74..bf13b0781fea 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_information_protection_policies_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_information_protection_policies_operations.py @@ -47,9 +47,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_get_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -81,10 +81,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +99,7 @@ def build_create_or_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,9 +116,9 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +127,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -190,10 +190,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InformationProtectionPolicy] + ) + cls: ClsType[_models.InformationProtectionPolicy] = kwargs.pop("cls", None) request = build_get_request( scope=scope, @@ -204,9 +204,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -223,7 +223,9 @@ def get( return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}"} # type: ignore + get.metadata = { + "url": "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}" + } @overload def create_or_update( @@ -329,11 +331,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InformationProtectionPolicy] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InformationProtectionPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -355,9 +357,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -374,11 +376,13 @@ def create_or_update( deserialized = self._deserialize("InformationProtectionPolicy", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}" + } @distributed_trace def list(self, scope: str, **kwargs: Any) -> Iterable["_models.InformationProtectionPolicy"]: @@ -398,10 +402,10 @@ def list(self, scope: str, **kwargs: Any) -> Iterable["_models.InformationProtec _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.InformationProtectionPolicyList] + ) + cls: ClsType[_models.InformationProtectionPolicyList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -422,7 +426,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -438,7 +442,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -446,13 +450,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("InformationProtectionPolicyList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -465,4 +469,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Security/informationProtectionPolicies"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Security/informationProtectionPolicies"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_security_contacts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_security_contacts_operations.py index 26de75d54020..95e93805eca8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_security_contacts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_security_contacts_operations.py @@ -45,9 +45,9 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,9 +73,9 @@ def build_get_request(security_contact_name: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +90,7 @@ def build_get_request(security_contact_name: str, subscription_id: str, **kwargs "securityContactName": _SERIALIZER.url("security_contact_name", security_contact_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -105,10 +105,10 @@ def build_create_request(security_contact_name: str, subscription_id: str, **kwa _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,7 +123,7 @@ def build_create_request(security_contact_name: str, subscription_id: str, **kwa "securityContactName": _SERIALIZER.url("security_contact_name", security_contact_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -140,9 +140,9 @@ def build_delete_request(security_contact_name: str, subscription_id: str, **kwa _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -157,7 +157,7 @@ def build_delete_request(security_contact_name: str, subscription_id: str, **kwa "securityContactName": _SERIALIZER.url("security_contact_name", security_contact_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -172,10 +172,10 @@ def build_update_request(security_contact_name: str, subscription_id: str, **kwa _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -190,7 +190,7 @@ def build_update_request(security_contact_name: str, subscription_id: str, **kwa "securityContactName": _SERIALIZER.url("security_contact_name", security_contact_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -235,10 +235,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.SecurityContact"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityContactList] + ) + cls: ClsType[_models.SecurityContactList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -259,7 +259,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -275,7 +275,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -283,13 +283,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityContactList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -302,7 +302,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts"} @distributed_trace def get(self, security_contact_name: str, **kwargs: Any) -> _models.SecurityContact: @@ -326,10 +326,10 @@ def get(self, security_contact_name: str, **kwargs: Any) -> _models.SecurityCont _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityContact] + ) + cls: ClsType[_models.SecurityContact] = kwargs.pop("cls", None) request = build_get_request( security_contact_name=security_contact_name, @@ -340,9 +340,9 @@ def get(self, security_contact_name: str, **kwargs: Any) -> _models.SecurityCont params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -359,7 +359,9 @@ def get(self, security_contact_name: str, **kwargs: Any) -> _models.SecurityCont return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}" + } @overload def create( @@ -434,11 +436,11 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityContact] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityContact] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -460,9 +462,9 @@ def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -479,7 +481,9 @@ def create( return deserialized - create.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}"} # type: ignore + create.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -505,10 +509,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( security_contact_name=security_contact_name, @@ -519,9 +523,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -534,7 +538,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}" + } @overload def update( @@ -609,11 +615,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityContact] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityContact] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -635,9 +641,9 @@ def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -654,4 +660,6 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_workspace_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_workspace_settings_operations.py index e246cf1e71b5..56cc517724af 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_workspace_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/operations/_workspace_settings_operations.py @@ -45,9 +45,9 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,9 +73,9 @@ def build_get_request(workspace_setting_name: str, subscription_id: str, **kwarg _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +90,7 @@ def build_get_request(workspace_setting_name: str, subscription_id: str, **kwarg "workspaceSettingName": _SERIALIZER.url("workspace_setting_name", workspace_setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -105,10 +105,10 @@ def build_create_request(workspace_setting_name: str, subscription_id: str, **kw _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,7 +123,7 @@ def build_create_request(workspace_setting_name: str, subscription_id: str, **kw "workspaceSettingName": _SERIALIZER.url("workspace_setting_name", workspace_setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -140,10 +140,10 @@ def build_update_request(workspace_setting_name: str, subscription_id: str, **kw _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -158,7 +158,7 @@ def build_update_request(workspace_setting_name: str, subscription_id: str, **kw "workspaceSettingName": _SERIALIZER.url("workspace_setting_name", workspace_setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -175,9 +175,9 @@ def build_delete_request(workspace_setting_name: str, subscription_id: str, **kw _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -192,7 +192,7 @@ def build_delete_request(workspace_setting_name: str, subscription_id: str, **kw "workspaceSettingName": _SERIALIZER.url("workspace_setting_name", workspace_setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -236,10 +236,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.WorkspaceSetting"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkspaceSettingList] + ) + cls: ClsType[_models.WorkspaceSettingList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -260,7 +260,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -276,7 +276,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -284,13 +284,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("WorkspaceSettingList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -303,7 +303,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings"} @distributed_trace def get(self, workspace_setting_name: str, **kwargs: Any) -> _models.WorkspaceSetting: @@ -328,10 +328,10 @@ def get(self, workspace_setting_name: str, **kwargs: Any) -> _models.WorkspaceSe _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkspaceSetting] + ) + cls: ClsType[_models.WorkspaceSetting] = kwargs.pop("cls", None) request = build_get_request( workspace_setting_name=workspace_setting_name, @@ -342,9 +342,9 @@ def get(self, workspace_setting_name: str, **kwargs: Any) -> _models.WorkspaceSe params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -361,7 +361,9 @@ def get(self, workspace_setting_name: str, **kwargs: Any) -> _models.WorkspaceSe return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}" + } @overload def create( @@ -441,11 +443,11 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkspaceSetting] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WorkspaceSetting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -467,9 +469,9 @@ def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -486,7 +488,9 @@ def create( return deserialized - create.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}"} # type: ignore + create.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}" + } @overload def update( @@ -566,11 +570,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkspaceSetting] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WorkspaceSetting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -592,9 +596,9 @@ def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -611,7 +615,9 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -638,10 +644,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2017-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2017-08-01-preview") - ) # type: Literal["2017-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( workspace_setting_name=workspace_setting_name, @@ -652,9 +658,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -667,4 +673,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_configuration.py index 1a9383b9ca50..51e623ca6fe7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-06-01") # type: Literal["2018-06-01"] + api_version: Literal["2018-06-01"] = kwargs.pop("api_version", "2018-06-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_metadata.json index a257924c29e6..0dfc6cf8bce7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_security_center.py index e0d6757c1d68..2d98b587d98f 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import PricingsOperations @@ -48,7 +48,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -76,15 +76,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/_configuration.py index 71ecbf233ba3..00ef4f7e6b54 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2018-06-01") # type: Literal["2018-06-01"] + api_version: Literal["2018-06-01"] = kwargs.pop("api_version", "2018-06-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/_security_center.py index 86c43ee8c1f2..10b1d0f340d5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import PricingsOperations @@ -48,7 +48,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/operations/__init__.py index 81b7ce3e1103..3f34d5a48636 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/operations/__init__.py @@ -9,7 +9,7 @@ from ._pricings_operations import PricingsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/operations/_pricings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/operations/_pricings_operations.py index 16cf1bb363a4..7c7c8f4cda78 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/operations/_pricings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/aio/operations/_pricings_operations.py @@ -75,8 +75,8 @@ async def list(self, **kwargs: Any) -> _models.PricingList: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PricingList] + api_version: Literal["2018-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + cls: ClsType[_models.PricingList] = kwargs.pop("cls", None) request = build_list_request( subscription_id=self._config.subscription_id, @@ -86,9 +86,9 @@ async def list(self, **kwargs: Any) -> _models.PricingList: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -105,7 +105,7 @@ async def list(self, **kwargs: Any) -> _models.PricingList: return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings"} @distributed_trace_async async def get(self, pricing_name: str, **kwargs: Any) -> _models.Pricing: @@ -129,8 +129,8 @@ async def get(self, pricing_name: str, **kwargs: Any) -> _models.Pricing: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Pricing] + api_version: Literal["2018-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + cls: ClsType[_models.Pricing] = kwargs.pop("cls", None) request = build_get_request( pricing_name=pricing_name, @@ -141,9 +141,9 @@ async def get(self, pricing_name: str, **kwargs: Any) -> _models.Pricing: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -160,7 +160,7 @@ async def get(self, pricing_name: str, **kwargs: Any) -> _models.Pricing: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"} @overload async def update( @@ -227,9 +227,9 @@ async def update(self, pricing_name: str, pricing: Union[_models.Pricing, IO], * _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Pricing] + api_version: Literal["2018-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pricing] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -251,9 +251,9 @@ async def update(self, pricing_name: str, pricing: Union[_models.Pricing, IO], * params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -270,4 +270,4 @@ async def update(self, pricing_name: str, pricing: Union[_models.Pricing, IO], * return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"} # type: ignore + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/models/__init__.py index a6335e2b1d2d..82e99d49aec6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/models/__init__.py @@ -14,7 +14,7 @@ from ._security_center_enums import PricingTier from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/operations/__init__.py index 81b7ce3e1103..3f34d5a48636 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/operations/__init__.py @@ -9,7 +9,7 @@ from ._pricings_operations import PricingsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/operations/_pricings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/operations/_pricings_operations.py index f45646b09a91..8687eb48393e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/operations/_pricings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/operations/_pricings_operations.py @@ -43,7 +43,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 = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] + api_version: Literal["2018-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,7 +54,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -69,7 +69,7 @@ def build_get_request(pricing_name: str, subscription_id: str, **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] + api_version: Literal["2018-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +83,7 @@ def build_get_request(pricing_name: str, subscription_id: str, **kwargs: Any) -> "pricingName": _SERIALIZER.url("pricing_name", pricing_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -98,8 +98,8 @@ def build_update_request(pricing_name: str, subscription_id: str, **kwargs: Any) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2018-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +113,7 @@ def build_update_request(pricing_name: str, subscription_id: str, **kwargs: Any) "pricingName": _SERIALIZER.url("pricing_name", pricing_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -165,8 +165,8 @@ def list(self, **kwargs: Any) -> _models.PricingList: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PricingList] + api_version: Literal["2018-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + cls: ClsType[_models.PricingList] = kwargs.pop("cls", None) request = build_list_request( subscription_id=self._config.subscription_id, @@ -176,9 +176,9 @@ def list(self, **kwargs: Any) -> _models.PricingList: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -195,7 +195,7 @@ def list(self, **kwargs: Any) -> _models.PricingList: return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings"} @distributed_trace def get(self, pricing_name: str, **kwargs: Any) -> _models.Pricing: @@ -219,8 +219,8 @@ def get(self, pricing_name: str, **kwargs: Any) -> _models.Pricing: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Pricing] + api_version: Literal["2018-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + cls: ClsType[_models.Pricing] = kwargs.pop("cls", None) request = build_get_request( pricing_name=pricing_name, @@ -231,9 +231,9 @@ def get(self, pricing_name: str, **kwargs: Any) -> _models.Pricing: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -250,7 +250,7 @@ def get(self, pricing_name: str, **kwargs: Any) -> _models.Pricing: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"} @overload def update( @@ -317,9 +317,9 @@ def update(self, pricing_name: str, pricing: Union[_models.Pricing, IO], **kwarg _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) # type: Literal["2018-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Pricing] + api_version: Literal["2018-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2018-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pricing] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -341,9 +341,9 @@ def update(self, pricing_name: str, pricing: Union[_models.Pricing, IO], **kwarg params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -360,4 +360,4 @@ def update(self, pricing_name: str, pricing: Union[_models.Pricing, IO], **kwarg return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"} # type: ignore + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_configuration.py index e06429a27991..045475e6f425 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_configuration.py @@ -40,7 +40,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-01-01") # type: Literal["2019-01-01"] + api_version: Literal["2019-01-01"] = kwargs.pop("api_version", "2019-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,10 +51,7 @@ def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None: kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_metadata.json index 5b738d4c8656..1b37af97f86f 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_metadata.json @@ -36,7 +36,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -48,7 +48,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_security_center.py index ccfc826e7e45..c85238515781 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import AdvancedThreatProtectionOperations @@ -43,7 +43,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -73,15 +73,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/_configuration.py index 5d8fbb0d22b9..6bb593062b3f 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/_configuration.py @@ -40,7 +40,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-01-01") # type: Literal["2019-01-01"] + api_version: Literal["2019-01-01"] = kwargs.pop("api_version", "2019-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/_security_center.py index 17f3bffc91f0..fd6c736b0367 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import AdvancedThreatProtectionOperations @@ -43,7 +43,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/operations/__init__.py index 6da7520b4298..950166c69a9b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/operations/__init__.py @@ -9,7 +9,7 @@ from ._advanced_threat_protection_operations import AdvancedThreatProtectionOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/operations/_advanced_threat_protection_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/operations/_advanced_threat_protection_operations.py index 28684d54f261..a48860465c9e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/operations/_advanced_threat_protection_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/aio/operations/_advanced_threat_protection_operations.py @@ -80,9 +80,9 @@ async def get(self, resource_id: str, **kwargs: Any) -> _models.AdvancedThreatPr _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) # type: Literal["2019-01-01"] - setting_name = kwargs.pop("setting_name", "current") # type: Literal["current"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdvancedThreatProtectionSetting] + api_version: Literal["2019-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + setting_name: Literal["current"] = kwargs.pop("setting_name", "current") + cls: ClsType[_models.AdvancedThreatProtectionSetting] = kwargs.pop("cls", None) request = build_get_request( resource_id=resource_id, @@ -93,9 +93,9 @@ async def get(self, resource_id: str, **kwargs: Any) -> _models.AdvancedThreatPr params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -112,7 +112,7 @@ async def get(self, resource_id: str, **kwargs: Any) -> _models.AdvancedThreatPr return deserialized - get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}"} # type: ignore + get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}"} @overload async def create( @@ -206,10 +206,10 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) # type: Literal["2019-01-01"] - setting_name = kwargs.pop("setting_name", "current") # type: Literal["current"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdvancedThreatProtectionSetting] + api_version: Literal["2019-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + setting_name: Literal["current"] = kwargs.pop("setting_name", "current") + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AdvancedThreatProtectionSetting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -231,9 +231,9 @@ async def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -250,4 +250,6 @@ async def create( return deserialized - create.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}"} # type: ignore + create.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/models/__init__.py index d04090e27218..8c7246cc6182 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/models/__init__.py @@ -11,7 +11,7 @@ from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import Resource from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/operations/__init__.py index 6da7520b4298..950166c69a9b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/operations/__init__.py @@ -9,7 +9,7 @@ from ._advanced_threat_protection_operations import AdvancedThreatProtectionOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/operations/_advanced_threat_protection_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/operations/_advanced_threat_protection_operations.py index 28b043a74cbb..b807101ec732 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/operations/_advanced_threat_protection_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/operations/_advanced_threat_protection_operations.py @@ -43,8 +43,8 @@ def build_get_request(resource_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) # type: Literal["2019-01-01"] - setting_name = kwargs.pop("setting_name", "current") # type: Literal["current"] + api_version: Literal["2019-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + setting_name: Literal["current"] = kwargs.pop("setting_name", "current") accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_get_request(resource_id: str, **kwargs: Any) -> HttpRequest: "settingName": _SERIALIZER.url("setting_name", setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -71,9 +71,9 @@ def build_create_request(resource_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) # type: Literal["2019-01-01"] - setting_name = kwargs.pop("setting_name", "current") # type: Literal["current"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2019-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + setting_name: Literal["current"] = kwargs.pop("setting_name", "current") + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_create_request(resource_id: str, **kwargs: Any) -> HttpRequest: "settingName": _SERIALIZER.url("setting_name", setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,9 +142,9 @@ def get(self, resource_id: str, **kwargs: Any) -> _models.AdvancedThreatProtecti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) # type: Literal["2019-01-01"] - setting_name = kwargs.pop("setting_name", "current") # type: Literal["current"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdvancedThreatProtectionSetting] + api_version: Literal["2019-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + setting_name: Literal["current"] = kwargs.pop("setting_name", "current") + cls: ClsType[_models.AdvancedThreatProtectionSetting] = kwargs.pop("cls", None) request = build_get_request( resource_id=resource_id, @@ -155,9 +155,9 @@ def get(self, resource_id: str, **kwargs: Any) -> _models.AdvancedThreatProtecti params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -174,7 +174,7 @@ def get(self, resource_id: str, **kwargs: Any) -> _models.AdvancedThreatProtecti return deserialized - get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}"} # type: ignore + get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}"} @overload def create( @@ -268,10 +268,10 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) # type: Literal["2019-01-01"] - setting_name = kwargs.pop("setting_name", "current") # type: Literal["current"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdvancedThreatProtectionSetting] + api_version: Literal["2019-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-01-01")) + setting_name: Literal["current"] = kwargs.pop("setting_name", "current") + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AdvancedThreatProtectionSetting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -293,9 +293,9 @@ def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -312,4 +312,6 @@ def create( return deserialized - create.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}"} # type: ignore + create.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_configuration.py index e0525d39cb17..e9a2fdedb7a4 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-01-01-preview") # type: Literal["2019-01-01-preview"] + api_version: Literal["2019-01-01-preview"] = kwargs.pop("api_version", "2019-01-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_metadata.json index 65712a8b6388..78373e0adde8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_security_center.py index a5196bde8981..910de1cd3c95 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ( @@ -70,7 +70,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -111,15 +111,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/_configuration.py index 6cd221fea7b4..e2e92c2aa6a9 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-01-01-preview") # type: Literal["2019-01-01-preview"] + api_version: Literal["2019-01-01-preview"] = kwargs.pop("api_version", "2019-01-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/_security_center.py index 5e6f806c4263..c2d81d41de54 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ( @@ -71,7 +71,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/__init__.py index aeb88535eb28..e25e3fcfcdf1 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/__init__.py @@ -14,7 +14,7 @@ from ._alerts_suppression_rules_operations import AlertsSuppressionRulesOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_alerts_suppression_rules_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_alerts_suppression_rules_operations.py index eeb3135f3277..f04e3164e334 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_alerts_suppression_rules_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_alerts_suppression_rules_operations.py @@ -79,10 +79,10 @@ def list(self, alert_type: Optional[str] = None, **kwargs: Any) -> AsyncIterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertsSuppressionRulesList] + ) + cls: ClsType[_models.AlertsSuppressionRulesList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -104,7 +104,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -120,7 +120,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -128,13 +128,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AlertsSuppressionRulesList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -147,7 +147,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules"} @distributed_trace_async async def get(self, alerts_suppression_rule_name: str, **kwargs: Any) -> _models.AlertsSuppressionRule: @@ -171,10 +171,10 @@ async def get(self, alerts_suppression_rule_name: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertsSuppressionRule] + ) + cls: ClsType[_models.AlertsSuppressionRule] = kwargs.pop("cls", None) request = build_get_request( alerts_suppression_rule_name=alerts_suppression_rule_name, @@ -185,9 +185,9 @@ async def get(self, alerts_suppression_rule_name: str, **kwargs: Any) -> _models params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -204,7 +204,9 @@ async def get(self, alerts_suppression_rule_name: str, **kwargs: Any) -> _models return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}" + } @overload async def update( @@ -289,11 +291,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertsSuppressionRule] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AlertsSuppressionRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -315,9 +317,9 @@ async def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -334,7 +336,9 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -360,10 +364,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( alerts_suppression_rule_name=alerts_suppression_rule_name, @@ -374,9 +378,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -389,4 +393,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_automations_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_automations_operations.py index 6947366b1082..b7540963abc6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_automations_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_automations_operations.py @@ -79,10 +79,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Automation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AutomationList] + ) + cls: ClsType[_models.AutomationList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -103,7 +103,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -119,7 +119,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -127,13 +127,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AutomationList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -146,7 +146,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/automations"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/automations"} @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Automation"]: @@ -165,10 +165,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AutomationList] + ) + cls: ClsType[_models.AutomationList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -190,7 +190,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -206,7 +206,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -214,13 +214,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AutomationList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -233,7 +233,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations" + } @distributed_trace_async async def get(self, resource_group_name: str, automation_name: str, **kwargs: Any) -> _models.Automation: @@ -260,10 +262,10 @@ async def get(self, resource_group_name: str, automation_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Automation] + ) + cls: ClsType[_models.Automation] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -275,9 +277,9 @@ async def get(self, resource_group_name: str, automation_name: str, **kwargs: An params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -294,7 +296,9 @@ async def get(self, resource_group_name: str, automation_name: str, **kwargs: An return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}" + } @overload async def create_or_update( @@ -388,11 +392,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Automation] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Automation] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -415,9 +419,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -434,11 +438,13 @@ async def create_or_update( deserialized = self._deserialize("Automation", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -467,10 +473,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -482,9 +488,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -497,7 +503,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}" + } @overload async def validate( @@ -591,11 +599,11 @@ async def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AutomationValidationStatus] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutomationValidationStatus] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -618,9 +626,9 @@ async def validate( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -637,4 +645,6 @@ async def validate( return deserialized - validate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}/validate"} # type: ignore + validate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}/validate" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_regulatory_compliance_assessments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_regulatory_compliance_assessments_operations.py index 0da66fe3d056..c1cfd144eeb2 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_regulatory_compliance_assessments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_regulatory_compliance_assessments_operations.py @@ -86,10 +86,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RegulatoryComplianceAssessmentList] + ) + cls: ClsType[_models.RegulatoryComplianceAssessmentList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -113,7 +113,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -129,7 +129,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -137,13 +137,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RegulatoryComplianceAssessmentList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -156,7 +156,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments" + } @distributed_trace_async async def get( @@ -193,10 +195,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RegulatoryComplianceAssessment] + ) + cls: ClsType[_models.RegulatoryComplianceAssessment] = kwargs.pop("cls", None) request = build_get_request( regulatory_compliance_standard_name=regulatory_compliance_standard_name, @@ -209,9 +211,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -228,4 +230,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_regulatory_compliance_controls_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_regulatory_compliance_controls_operations.py index c33dad3da474..24d41d68eaf8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_regulatory_compliance_controls_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_regulatory_compliance_controls_operations.py @@ -79,10 +79,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RegulatoryComplianceControlList] + ) + cls: ClsType[_models.RegulatoryComplianceControlList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -105,7 +105,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -121,7 +121,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -129,13 +129,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RegulatoryComplianceControlList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -148,7 +148,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls" + } @distributed_trace_async async def get( @@ -178,10 +180,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RegulatoryComplianceControl] + ) + cls: ClsType[_models.RegulatoryComplianceControl] = kwargs.pop("cls", None) request = build_get_request( regulatory_compliance_standard_name=regulatory_compliance_standard_name, @@ -193,9 +195,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -212,4 +214,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_regulatory_compliance_standards_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_regulatory_compliance_standards_operations.py index a1a59794d533..7e008acf9f61 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_regulatory_compliance_standards_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_regulatory_compliance_standards_operations.py @@ -76,10 +76,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RegulatoryComplianceStandardList] + ) + cls: ClsType[_models.RegulatoryComplianceStandardList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -101,7 +101,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -117,7 +117,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -125,13 +125,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("RegulatoryComplianceStandardList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -144,7 +144,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards" + } @distributed_trace_async async def get( @@ -171,10 +173,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RegulatoryComplianceStandard] + ) + cls: ClsType[_models.RegulatoryComplianceStandard] = kwargs.pop("cls", None) request = build_get_request( regulatory_compliance_standard_name=regulatory_compliance_standard_name, @@ -185,9 +187,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -204,4 +206,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_sub_assessments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_sub_assessments_operations.py index 3522593c3c28..024190bec6fb 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_sub_assessments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/aio/operations/_sub_assessments_operations.py @@ -76,10 +76,10 @@ def list_all(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.Security _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecuritySubAssessmentList] + ) + cls: ClsType[_models.SecuritySubAssessmentList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -100,7 +100,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -116,7 +116,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -124,13 +124,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecuritySubAssessmentList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -143,7 +143,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_all.metadata = {"url": "/{scope}/providers/Microsoft.Security/subAssessments"} # type: ignore + list_all.metadata = {"url": "/{scope}/providers/Microsoft.Security/subAssessments"} @distributed_trace def list(self, scope: str, assessment_name: str, **kwargs: Any) -> AsyncIterable["_models.SecuritySubAssessment"]: @@ -165,10 +165,10 @@ def list(self, scope: str, assessment_name: str, **kwargs: Any) -> AsyncIterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecuritySubAssessmentList] + ) + cls: ClsType[_models.SecuritySubAssessmentList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -190,7 +190,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -206,7 +206,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -214,13 +214,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecuritySubAssessmentList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -233,7 +233,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments"} @distributed_trace_async async def get( @@ -266,10 +266,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecuritySubAssessment] + ) + cls: ClsType[_models.SecuritySubAssessment] = kwargs.pop("cls", None) request = build_get_request( scope=scope, @@ -281,9 +281,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -300,4 +300,6 @@ async def get( return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName}"} # type: ignore + get.metadata = { + "url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/models/__init__.py index 09a25196df77..93bc6625aac2 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/models/__init__.py @@ -61,7 +61,7 @@ from ._security_center_enums import State from ._security_center_enums import SubAssessmentStatusCode from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/models/_models_py3.py index 2c43420efd06..eff873300613 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/models/_models_py3.py @@ -51,7 +51,7 @@ class AdditionalData(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.assessed_resource_type = None # type: Optional[str] + self.assessed_resource_type: Optional[str] = None class Resource(_serialization.Model): @@ -494,7 +494,7 @@ class AutomationAction(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.action_type = None # type: Optional[str] + self.action_type: Optional[str] = None class AutomationActionEventHub(AutomationAction): @@ -539,7 +539,7 @@ def __init__( :paramtype connection_string: str """ super().__init__(**kwargs) - self.action_type = "EventHub" # type: str + self.action_type: str = "EventHub" self.event_hub_resource_id = event_hub_resource_id self.sas_policy_name = None self.connection_string = connection_string @@ -579,7 +579,7 @@ def __init__(self, *, logic_app_resource_id: Optional[str] = None, uri: Optional :paramtype uri: str """ super().__init__(**kwargs) - self.action_type = "LogicApp" # type: str + self.action_type: str = "LogicApp" self.logic_app_resource_id = logic_app_resource_id self.uri = uri @@ -611,7 +611,7 @@ def __init__(self, *, workspace_resource_id: Optional[str] = None, **kwargs): :paramtype workspace_resource_id: str """ super().__init__(**kwargs) - self.action_type = "Workspace" # type: str + self.action_type: str = "Workspace" self.workspace_resource_id = workspace_resource_id @@ -844,7 +844,7 @@ class ResourceDetails(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.source = None # type: Optional[str] + self.source: Optional[str] = None class AzureResourceDetails(ResourceDetails): @@ -874,7 +874,7 @@ class AzureResourceDetails(ResourceDetails): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.source = "Azure" # type: str + self.source: str = "Azure" self.id = None @@ -980,7 +980,7 @@ class ContainerRegistryVulnerabilityProperties(AdditionalData): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.assessed_resource_type = "ContainerRegistryVulnerability" # type: str + self.assessed_resource_type: str = "ContainerRegistryVulnerability" self.type = None self.cvss = None self.patchable = None @@ -1121,7 +1121,7 @@ def __init__(self, *, workspace_id: str, vmuuid: str, source_computer_id: str, m :paramtype machine_name: str """ super().__init__(**kwargs) - self.source = "OnPremise" # type: str + self.source: str = "OnPremise" self.workspace_id = workspace_id self.vmuuid = vmuuid self.source_computer_id = source_computer_id @@ -1202,7 +1202,7 @@ def __init__( machine_name=machine_name, **kwargs ) - self.source = "OnPremiseSql" # type: str + self.source: str = "OnPremiseSql" self.server_name = server_name self.database_name = database_name @@ -1716,7 +1716,7 @@ class ServerVulnerabilityProperties(AdditionalData): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.assessed_resource_type = "ServerVulnerabilityAssessment" # type: str + self.assessed_resource_type: str = "ServerVulnerabilityAssessment" self.type = None self.cvss = None self.patchable = None @@ -1758,7 +1758,7 @@ class SqlServerVulnerabilityProperties(AdditionalData): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.assessed_resource_type = "SqlServerVulnerability" # type: str + self.assessed_resource_type: str = "SqlServerVulnerability" self.type = None self.query = None diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/__init__.py index aeb88535eb28..e25e3fcfcdf1 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/__init__.py @@ -14,7 +14,7 @@ from ._alerts_suppression_rules_operations import AlertsSuppressionRulesOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_alerts_suppression_rules_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_alerts_suppression_rules_operations.py index 276f7999f3a4..592f615f31a5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_alerts_suppression_rules_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_alerts_suppression_rules_operations.py @@ -45,9 +45,9 @@ def build_list_request(subscription_id: str, *, alert_type: Optional[str] = None _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_request(subscription_id: str, *, alert_type: Optional[str] = None ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -77,9 +77,9 @@ def build_get_request(alerts_suppression_rule_name: str, subscription_id: str, * _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_get_request(alerts_suppression_rule_name: str, subscription_id: str, * ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -111,10 +111,10 @@ def build_update_request(alerts_suppression_rule_name: str, subscription_id: str _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +131,7 @@ def build_update_request(alerts_suppression_rule_name: str, subscription_id: str ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -148,9 +148,9 @@ def build_delete_request(alerts_suppression_rule_name: str, subscription_id: str _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -167,7 +167,7 @@ def build_delete_request(alerts_suppression_rule_name: str, subscription_id: str ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -213,10 +213,10 @@ def list(self, alert_type: Optional[str] = None, **kwargs: Any) -> Iterable["_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertsSuppressionRulesList] + ) + cls: ClsType[_models.AlertsSuppressionRulesList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -238,7 +238,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -254,7 +254,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -262,13 +262,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AlertsSuppressionRulesList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -281,7 +281,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules"} @distributed_trace def get(self, alerts_suppression_rule_name: str, **kwargs: Any) -> _models.AlertsSuppressionRule: @@ -305,10 +305,10 @@ def get(self, alerts_suppression_rule_name: str, **kwargs: Any) -> _models.Alert _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertsSuppressionRule] + ) + cls: ClsType[_models.AlertsSuppressionRule] = kwargs.pop("cls", None) request = build_get_request( alerts_suppression_rule_name=alerts_suppression_rule_name, @@ -319,9 +319,9 @@ def get(self, alerts_suppression_rule_name: str, **kwargs: Any) -> _models.Alert params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -338,7 +338,9 @@ def get(self, alerts_suppression_rule_name: str, **kwargs: Any) -> _models.Alert return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}" + } @overload def update( @@ -423,11 +425,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertsSuppressionRule] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AlertsSuppressionRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -449,9 +451,9 @@ def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -468,7 +470,9 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -494,10 +498,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( alerts_suppression_rule_name=alerts_suppression_rule_name, @@ -508,9 +512,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -523,4 +527,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_automations_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_automations_operations.py index 0a0b26b9ab24..15d27ba75262 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_automations_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_automations_operations.py @@ -45,9 +45,9 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,9 +73,9 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -109,9 +109,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -129,7 +129,7 @@ def build_get_request( "automationName": _SERIALIZER.url("automation_name", automation_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,10 +146,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -167,7 +167,7 @@ def build_create_or_update_request( "automationName": _SERIALIZER.url("automation_name", automation_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -186,9 +186,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -206,7 +206,7 @@ def build_delete_request( "automationName": _SERIALIZER.url("automation_name", automation_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -223,10 +223,10 @@ def build_validate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -244,7 +244,7 @@ def build_validate_request( "automationName": _SERIALIZER.url("automation_name", automation_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -290,10 +290,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.Automation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AutomationList] + ) + cls: ClsType[_models.AutomationList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -314,7 +314,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -330,7 +330,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -338,13 +338,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AutomationList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -357,7 +357,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/automations"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/automations"} @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Automation"]: @@ -376,10 +376,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AutomationList] + ) + cls: ClsType[_models.AutomationList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -401,7 +401,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -417,7 +417,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -425,13 +425,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AutomationList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -444,7 +444,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations" + } @distributed_trace def get(self, resource_group_name: str, automation_name: str, **kwargs: Any) -> _models.Automation: @@ -471,10 +473,10 @@ def get(self, resource_group_name: str, automation_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Automation] + ) + cls: ClsType[_models.Automation] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -486,9 +488,9 @@ def get(self, resource_group_name: str, automation_name: str, **kwargs: Any) -> params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -505,7 +507,9 @@ def get(self, resource_group_name: str, automation_name: str, **kwargs: Any) -> return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}" + } @overload def create_or_update( @@ -599,11 +603,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Automation] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Automation] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -626,9 +630,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -645,11 +649,13 @@ def create_or_update( deserialized = self._deserialize("Automation", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -678,10 +684,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -693,9 +699,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -708,7 +714,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}" + } @overload def validate( @@ -802,11 +810,11 @@ def validate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AutomationValidationStatus] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AutomationValidationStatus] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -829,9 +837,9 @@ def validate( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -848,4 +856,6 @@ def validate( return deserialized - validate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}/validate"} # type: ignore + validate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}/validate" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_regulatory_compliance_assessments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_regulatory_compliance_assessments_operations.py index 60392fa32a0e..9e043552b7e7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_regulatory_compliance_assessments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_regulatory_compliance_assessments_operations.py @@ -52,9 +52,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,7 @@ def build_list_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -97,9 +97,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -122,7 +122,7 @@ def build_get_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -180,10 +180,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RegulatoryComplianceAssessmentList] + ) + cls: ClsType[_models.RegulatoryComplianceAssessmentList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -207,7 +207,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -223,7 +223,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -231,13 +231,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RegulatoryComplianceAssessmentList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -250,7 +250,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments" + } @distributed_trace def get( @@ -287,10 +289,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RegulatoryComplianceAssessment] + ) + cls: ClsType[_models.RegulatoryComplianceAssessment] = kwargs.pop("cls", None) request = build_get_request( regulatory_compliance_standard_name=regulatory_compliance_standard_name, @@ -303,9 +305,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -322,4 +324,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_regulatory_compliance_controls_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_regulatory_compliance_controls_operations.py index ece9fd34ccb4..d3286ad449f5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_regulatory_compliance_controls_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_regulatory_compliance_controls_operations.py @@ -47,9 +47,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -66,7 +66,7 @@ def build_list_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -88,9 +88,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,7 +110,7 @@ def build_get_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -161,10 +161,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RegulatoryComplianceControlList] + ) + cls: ClsType[_models.RegulatoryComplianceControlList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -187,7 +187,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -203,7 +203,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -211,13 +211,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RegulatoryComplianceControlList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -230,7 +230,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls" + } @distributed_trace def get( @@ -260,10 +262,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RegulatoryComplianceControl] + ) + cls: ClsType[_models.RegulatoryComplianceControl] = kwargs.pop("cls", None) request = build_get_request( regulatory_compliance_standard_name=regulatory_compliance_standard_name, @@ -275,9 +277,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -294,4 +296,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_regulatory_compliance_standards_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_regulatory_compliance_standards_operations.py index 6a5a0161789e..4e0c65184249 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_regulatory_compliance_standards_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_regulatory_compliance_standards_operations.py @@ -45,9 +45,9 @@ def build_list_request(subscription_id: str, *, filter: Optional[str] = None, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_request(subscription_id: str, *, filter: Optional[str] = None, ** ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -77,9 +77,9 @@ def build_get_request(regulatory_compliance_standard_name: str, subscription_id: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_get_request(regulatory_compliance_standard_name: str, subscription_id: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,10 +142,10 @@ def list(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RegulatoryComplianceStandardList] + ) + cls: ClsType[_models.RegulatoryComplianceStandardList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -167,7 +167,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -183,7 +183,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -191,13 +191,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("RegulatoryComplianceStandardList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -210,7 +210,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards" + } @distributed_trace def get(self, regulatory_compliance_standard_name: str, **kwargs: Any) -> _models.RegulatoryComplianceStandard: @@ -235,10 +237,10 @@ def get(self, regulatory_compliance_standard_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RegulatoryComplianceStandard] + ) + cls: ClsType[_models.RegulatoryComplianceStandard] = kwargs.pop("cls", None) request = build_get_request( regulatory_compliance_standard_name=regulatory_compliance_standard_name, @@ -249,9 +251,9 @@ def get(self, regulatory_compliance_standard_name: str, **kwargs: Any) -> _model params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -268,4 +270,6 @@ def get(self, regulatory_compliance_standard_name: str, **kwargs: Any) -> _model return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_sub_assessments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_sub_assessments_operations.py index a4ddd7978895..5fb21919cc2b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_sub_assessments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/operations/_sub_assessments_operations.py @@ -45,9 +45,9 @@ def build_list_all_request(scope: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_all_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -71,9 +71,9 @@ def build_list_request(scope: str, assessment_name: str, **kwargs: Any) -> HttpR _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_list_request(scope: str, assessment_name: str, **kwargs: Any) -> HttpR "assessmentName": _SERIALIZER.url("assessment_name", assessment_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -100,9 +100,9 @@ def build_get_request(scope: str, assessment_name: str, sub_assessment_name: str _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,7 +116,7 @@ def build_get_request(scope: str, assessment_name: str, sub_assessment_name: str "subAssessmentName": _SERIALIZER.url("sub_assessment_name", sub_assessment_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,10 +164,10 @@ def list_all(self, scope: str, **kwargs: Any) -> Iterable["_models.SecuritySubAs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecuritySubAssessmentList] + ) + cls: ClsType[_models.SecuritySubAssessmentList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -188,7 +188,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -204,7 +204,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -212,13 +212,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecuritySubAssessmentList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -231,7 +231,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_all.metadata = {"url": "/{scope}/providers/Microsoft.Security/subAssessments"} # type: ignore + list_all.metadata = {"url": "/{scope}/providers/Microsoft.Security/subAssessments"} @distributed_trace def list(self, scope: str, assessment_name: str, **kwargs: Any) -> Iterable["_models.SecuritySubAssessment"]: @@ -253,10 +253,10 @@ def list(self, scope: str, assessment_name: str, **kwargs: Any) -> Iterable["_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecuritySubAssessmentList] + ) + cls: ClsType[_models.SecuritySubAssessmentList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -278,7 +278,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -294,7 +294,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -302,13 +302,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecuritySubAssessmentList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -321,7 +321,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments"} @distributed_trace def get( @@ -354,10 +354,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2019-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2019-01-01-preview") - ) # type: Literal["2019-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecuritySubAssessment] + ) + cls: ClsType[_models.SecuritySubAssessment] = kwargs.pop("cls", None) request = build_get_request( scope=scope, @@ -369,9 +369,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -388,4 +388,6 @@ def get( return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName}"} # type: ignore + get.metadata = { + "url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_configuration.py index 0eef7f710a06..194b5d0e8368 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-08-01") # type: Literal["2019-08-01"] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", "2019-08-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_metadata.json index fb4dc9f00646..2fe8bc26426f 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_security_center.py index 355a95c07258..9c094a09dc58 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ( @@ -69,7 +69,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -111,15 +111,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/_configuration.py index ad5b17e974bf..63f3bee448f3 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2019-08-01") # type: Literal["2019-08-01"] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", "2019-08-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/_security_center.py index aedc96bb370a..5eb9fdb4f2f9 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ( @@ -69,7 +69,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/__init__.py index 9659bbd2cebc..8f30c8ed00eb 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/__init__.py @@ -17,7 +17,7 @@ from ._iot_security_solution_operations import IotSecuritySolutionOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_device_security_groups_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_device_security_groups_operations.py index cbbc47d24a29..c35932eb0bb3 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_device_security_groups_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_device_security_groups_operations.py @@ -78,8 +78,8 @@ def list(self, resource_id: str, **kwargs: Any) -> AsyncIterable["_models.Device _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeviceSecurityGroupList] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.DeviceSecurityGroupList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -100,7 +100,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -116,7 +116,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -124,13 +124,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DeviceSecurityGroupList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -143,7 +143,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups"} # type: ignore + list.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups"} @distributed_trace_async async def get( @@ -172,8 +172,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeviceSecurityGroup] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.DeviceSecurityGroup] = kwargs.pop("cls", None) request = build_get_request( resource_id=resource_id, @@ -184,9 +184,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -203,7 +203,7 @@ async def get( return deserialized - get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}"} # type: ignore + get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}"} @overload async def create_or_update( @@ -301,9 +301,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeviceSecurityGroup] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DeviceSecurityGroup] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -325,9 +325,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -344,11 +344,13 @@ async def create_or_update( deserialized = self._deserialize("DeviceSecurityGroup", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}"} # type: ignore + create_or_update.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -377,8 +379,8 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_id=resource_id, @@ -389,9 +391,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -404,4 +406,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}"} # type: ignore + delete.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_iot_security_solution_analytics_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_iot_security_solution_analytics_operations.py index d2a8e768d80e..b1fab1d6d21d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_iot_security_solution_analytics_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_iot_security_solution_analytics_operations.py @@ -82,8 +82,8 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecuritySolutionAnalyticsModelList] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecuritySolutionAnalyticsModelList] = kwargs.pop("cls", None) request = build_list_request( resource_group_name=resource_group_name, @@ -95,9 +95,9 @@ async def list( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -114,7 +114,9 @@ async def list( return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels" + } @distributed_trace_async async def get( @@ -143,8 +145,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecuritySolutionAnalyticsModel] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecuritySolutionAnalyticsModel] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -156,9 +158,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -175,4 +177,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_iot_security_solution_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_iot_security_solution_operations.py index 864360becbec..b18c937632c6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_iot_security_solution_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_iot_security_solution_operations.py @@ -84,8 +84,8 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecuritySolutionsList] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecuritySolutionsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -107,7 +107,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -123,7 +123,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -131,13 +131,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("IoTSecuritySolutionsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -150,7 +150,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions" + } @distributed_trace def list_by_resource_group( @@ -174,8 +176,8 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecuritySolutionsList] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecuritySolutionsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -198,7 +200,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -214,7 +216,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -222,13 +224,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("IoTSecuritySolutionsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -241,7 +243,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions" + } @distributed_trace_async async def get( @@ -270,8 +274,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecuritySolutionModel] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecuritySolutionModel] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -283,9 +287,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -302,7 +306,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}" + } @overload async def create_or_update( @@ -399,9 +405,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecuritySolutionModel] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IoTSecuritySolutionModel] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -424,9 +430,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -443,11 +449,13 @@ async def create_or_update( deserialized = self._deserialize("IoTSecuritySolutionModel", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}" + } @overload async def update( @@ -547,9 +555,9 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecuritySolutionModel] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IoTSecuritySolutionModel] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -572,9 +580,9 @@ async def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -591,7 +599,9 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -620,8 +630,8 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -633,9 +643,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -648,4 +658,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py index 313373854892..8e655a3712b6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py @@ -85,8 +85,8 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecurityAggregatedAlertList] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecurityAggregatedAlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,7 +110,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -126,7 +126,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -134,13 +134,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("IoTSecurityAggregatedAlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -153,7 +153,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts" + } @distributed_trace_async async def get( @@ -185,8 +187,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecurityAggregatedAlert] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecurityAggregatedAlert] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -199,9 +201,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -218,7 +220,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}" + } @distributed_trace_async async def dismiss( # pylint: disable=inconsistent-return-statements @@ -249,8 +253,8 @@ async def dismiss( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_dismiss_request( resource_group_name=resource_group_name, @@ -263,9 +267,9 @@ async def dismiss( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -278,4 +282,6 @@ async def dismiss( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - dismiss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}/dismiss"} # type: ignore + dismiss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}/dismiss" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_iot_security_solutions_analytics_recommendation_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_iot_security_solutions_analytics_recommendation_operations.py index 363466f760d9..d658762c9fa6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_iot_security_solutions_analytics_recommendation_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/aio/operations/_iot_security_solutions_analytics_recommendation_operations.py @@ -92,8 +92,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecurityAggregatedRecommendation] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecurityAggregatedRecommendation] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -106,9 +106,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -125,7 +125,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}" + } @distributed_trace def list( @@ -151,8 +153,8 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecurityAggregatedRecommendationList] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecurityAggregatedRecommendationList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -176,7 +178,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -192,7 +194,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -200,13 +202,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("IoTSecurityAggregatedRecommendationList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -219,4 +221,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/models/__init__.py index de83203b486b..e29bbfcaafc5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/models/__init__.py @@ -70,7 +70,7 @@ from ._security_center_enums import UnmaskedIpLoggingStatus from ._security_center_enums import ValueType from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/models/_models_py3.py index 9b2f75b45dcf..d4f1735c0040 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/models/_models_py3.py @@ -67,7 +67,7 @@ def __init__(self, *, is_enabled: bool, **kwargs): self.display_name = None self.description = None self.is_enabled = is_enabled - self.rule_type = None # type: Optional[str] + self.rule_type: Optional[str] = None class ThresholdCustomAlertRule(CustomAlertRule): @@ -124,7 +124,7 @@ def __init__(self, *, is_enabled: bool, min_threshold: int, max_threshold: int, :paramtype max_threshold: int """ super().__init__(is_enabled=is_enabled, **kwargs) - self.rule_type = "ThresholdCustomAlertRule" # type: str + self.rule_type: str = "ThresholdCustomAlertRule" self.min_threshold = min_threshold self.max_threshold = max_threshold @@ -223,7 +223,7 @@ def __init__( :paramtype time_window_size: ~datetime.timedelta """ super().__init__(is_enabled=is_enabled, min_threshold=min_threshold, max_threshold=max_threshold, **kwargs) - self.rule_type = "TimeWindowCustomAlertRule" # type: str + self.rule_type: str = "TimeWindowCustomAlertRule" self.time_window_size = time_window_size @@ -296,7 +296,7 @@ def __init__( time_window_size=time_window_size, **kwargs ) - self.rule_type = "ActiveConnectionsNotInAllowedRange" # type: str + self.rule_type: str = "ActiveConnectionsNotInAllowedRange" class AdditionalWorkspacesProperties(_serialization.Model): @@ -392,7 +392,7 @@ def __init__(self, *, is_enabled: bool, **kwargs): :paramtype is_enabled: bool """ super().__init__(is_enabled=is_enabled, **kwargs) - self.rule_type = "ListCustomAlertRule" # type: str + self.rule_type: str = "ListCustomAlertRule" self.value_type = None @@ -458,7 +458,7 @@ def __init__(self, *, is_enabled: bool, allowlist_values: List[str], **kwargs): :paramtype allowlist_values: list[str] """ super().__init__(is_enabled=is_enabled, **kwargs) - self.rule_type = "AllowlistCustomAlertRule" # type: str + self.rule_type: str = "AllowlistCustomAlertRule" self.allowlist_values = allowlist_values @@ -531,7 +531,7 @@ def __init__( time_window_size=time_window_size, **kwargs ) - self.rule_type = "AmqpC2DMessagesNotInAllowedRange" # type: str + self.rule_type: str = "AmqpC2DMessagesNotInAllowedRange" class AmqpC2DRejectedMessagesNotInAllowedRange(TimeWindowCustomAlertRule): @@ -603,7 +603,7 @@ def __init__( time_window_size=time_window_size, **kwargs ) - self.rule_type = "AmqpC2DRejectedMessagesNotInAllowedRange" # type: str + self.rule_type: str = "AmqpC2DRejectedMessagesNotInAllowedRange" class AmqpD2CMessagesNotInAllowedRange(TimeWindowCustomAlertRule): @@ -675,7 +675,7 @@ def __init__( time_window_size=time_window_size, **kwargs ) - self.rule_type = "AmqpD2CMessagesNotInAllowedRange" # type: str + self.rule_type: str = "AmqpD2CMessagesNotInAllowedRange" class CloudErrorBody(_serialization.Model): @@ -771,7 +771,7 @@ def __init__(self, *, is_enabled: bool, allowlist_values: List[str], **kwargs): :paramtype allowlist_values: list[str] """ super().__init__(is_enabled=is_enabled, allowlist_values=allowlist_values, **kwargs) - self.rule_type = "ConnectionFromIpNotAllowed" # type: str + self.rule_type: str = "ConnectionFromIpNotAllowed" class ConnectionToIpNotAllowed(AllowlistCustomAlertRule): @@ -824,7 +824,7 @@ def __init__(self, *, is_enabled: bool, allowlist_values: List[str], **kwargs): :paramtype allowlist_values: list[str] """ super().__init__(is_enabled=is_enabled, allowlist_values=allowlist_values, **kwargs) - self.rule_type = "ConnectionToIpNotAllowed" # type: str + self.rule_type: str = "ConnectionToIpNotAllowed" class DenylistCustomAlertRule(ListCustomAlertRule): @@ -877,7 +877,7 @@ def __init__(self, *, is_enabled: bool, denylist_values: List[str], **kwargs): :paramtype denylist_values: list[str] """ super().__init__(is_enabled=is_enabled, **kwargs) - self.rule_type = "DenylistCustomAlertRule" # type: str + self.rule_type: str = "DenylistCustomAlertRule" self.denylist_values = denylist_values @@ -1083,7 +1083,7 @@ def __init__( time_window_size=time_window_size, **kwargs ) - self.rule_type = "DirectMethodInvokesNotInAllowedRange" # type: str + self.rule_type: str = "DirectMethodInvokesNotInAllowedRange" class ErrorAdditionalInfo(_serialization.Model): @@ -1183,7 +1183,7 @@ def __init__( time_window_size=time_window_size, **kwargs ) - self.rule_type = "FailedLocalLoginsNotInAllowedRange" # type: str + self.rule_type: str = "FailedLocalLoginsNotInAllowedRange" class FileUploadsNotInAllowedRange(TimeWindowCustomAlertRule): @@ -1255,7 +1255,7 @@ def __init__( time_window_size=time_window_size, **kwargs ) - self.rule_type = "FileUploadsNotInAllowedRange" # type: str + self.rule_type: str = "FileUploadsNotInAllowedRange" class HttpC2DMessagesNotInAllowedRange(TimeWindowCustomAlertRule): @@ -1327,7 +1327,7 @@ def __init__( time_window_size=time_window_size, **kwargs ) - self.rule_type = "HttpC2DMessagesNotInAllowedRange" # type: str + self.rule_type: str = "HttpC2DMessagesNotInAllowedRange" class HttpC2DRejectedMessagesNotInAllowedRange(TimeWindowCustomAlertRule): @@ -1399,7 +1399,7 @@ def __init__( time_window_size=time_window_size, **kwargs ) - self.rule_type = "HttpC2DRejectedMessagesNotInAllowedRange" # type: str + self.rule_type: str = "HttpC2DRejectedMessagesNotInAllowedRange" class HttpD2CMessagesNotInAllowedRange(TimeWindowCustomAlertRule): @@ -1471,7 +1471,7 @@ def __init__( time_window_size=time_window_size, **kwargs ) - self.rule_type = "HttpD2CMessagesNotInAllowedRange" # type: str + self.rule_type: str = "HttpD2CMessagesNotInAllowedRange" class TagsResource(_serialization.Model): @@ -2323,7 +2323,7 @@ def __init__(self, *, is_enabled: bool, allowlist_values: List[str], **kwargs): :paramtype allowlist_values: list[str] """ super().__init__(is_enabled=is_enabled, allowlist_values=allowlist_values, **kwargs) - self.rule_type = "LocalUserNotAllowed" # type: str + self.rule_type: str = "LocalUserNotAllowed" class MqttC2DMessagesNotInAllowedRange(TimeWindowCustomAlertRule): @@ -2395,7 +2395,7 @@ def __init__( time_window_size=time_window_size, **kwargs ) - self.rule_type = "MqttC2DMessagesNotInAllowedRange" # type: str + self.rule_type: str = "MqttC2DMessagesNotInAllowedRange" class MqttC2DRejectedMessagesNotInAllowedRange(TimeWindowCustomAlertRule): @@ -2467,7 +2467,7 @@ def __init__( time_window_size=time_window_size, **kwargs ) - self.rule_type = "MqttC2DRejectedMessagesNotInAllowedRange" # type: str + self.rule_type: str = "MqttC2DRejectedMessagesNotInAllowedRange" class MqttD2CMessagesNotInAllowedRange(TimeWindowCustomAlertRule): @@ -2539,7 +2539,7 @@ def __init__( time_window_size=time_window_size, **kwargs ) - self.rule_type = "MqttD2CMessagesNotInAllowedRange" # type: str + self.rule_type: str = "MqttD2CMessagesNotInAllowedRange" class ProcessNotAllowed(AllowlistCustomAlertRule): @@ -2592,7 +2592,7 @@ def __init__(self, *, is_enabled: bool, allowlist_values: List[str], **kwargs): :paramtype allowlist_values: list[str] """ super().__init__(is_enabled=is_enabled, allowlist_values=allowlist_values, **kwargs) - self.rule_type = "ProcessNotAllowed" # type: str + self.rule_type: str = "ProcessNotAllowed" class QueuePurgesNotInAllowedRange(TimeWindowCustomAlertRule): @@ -2664,7 +2664,7 @@ def __init__( time_window_size=time_window_size, **kwargs ) - self.rule_type = "QueuePurgesNotInAllowedRange" # type: str + self.rule_type: str = "QueuePurgesNotInAllowedRange" class RecommendationConfigurationProperties(_serialization.Model): @@ -2861,7 +2861,7 @@ def __init__( time_window_size=time_window_size, **kwargs ) - self.rule_type = "TwinUpdatesNotInAllowedRange" # type: str + self.rule_type: str = "TwinUpdatesNotInAllowedRange" class UnauthorizedOperationsNotInAllowedRange(TimeWindowCustomAlertRule): @@ -2933,7 +2933,7 @@ def __init__( time_window_size=time_window_size, **kwargs ) - self.rule_type = "UnauthorizedOperationsNotInAllowedRange" # type: str + self.rule_type: str = "UnauthorizedOperationsNotInAllowedRange" class UpdateIotSecuritySolutionData(TagsResource): diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/__init__.py index 9659bbd2cebc..8f30c8ed00eb 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/__init__.py @@ -17,7 +17,7 @@ from ._iot_security_solution_operations import IotSecuritySolutionOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_device_security_groups_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_device_security_groups_operations.py index 4d8448b0db33..87cbc13012bd 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_device_security_groups_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_device_security_groups_operations.py @@ -45,7 +45,7 @@ def build_list_request(resource_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,7 +54,7 @@ def build_list_request(resource_id: str, **kwargs: Any) -> HttpRequest: "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -69,7 +69,7 @@ def build_get_request(resource_id: str, device_security_group_name: str, **kwarg _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +81,7 @@ def build_get_request(resource_id: str, device_security_group_name: str, **kwarg "deviceSecurityGroupName": _SERIALIZER.url("device_security_group_name", device_security_group_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -96,8 +96,8 @@ def build_create_or_update_request(resource_id: str, device_security_group_name: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +109,7 @@ def build_create_or_update_request(resource_id: str, device_security_group_name: "deviceSecurityGroupName": _SERIALIZER.url("device_security_group_name", device_security_group_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -126,7 +126,7 @@ def build_delete_request(resource_id: str, device_security_group_name: str, **kw _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -138,7 +138,7 @@ def build_delete_request(resource_id: str, device_security_group_name: str, **kw "deviceSecurityGroupName": _SERIALIZER.url("device_security_group_name", device_security_group_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -183,8 +183,8 @@ def list(self, resource_id: str, **kwargs: Any) -> Iterable["_models.DeviceSecur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeviceSecurityGroupList] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.DeviceSecurityGroupList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -205,7 +205,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -221,7 +221,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -229,13 +229,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DeviceSecurityGroupList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -248,7 +248,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups"} # type: ignore + list.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups"} @distributed_trace def get(self, resource_id: str, device_security_group_name: str, **kwargs: Any) -> _models.DeviceSecurityGroup: @@ -275,8 +275,8 @@ def get(self, resource_id: str, device_security_group_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeviceSecurityGroup] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.DeviceSecurityGroup] = kwargs.pop("cls", None) request = build_get_request( resource_id=resource_id, @@ -287,9 +287,9 @@ def get(self, resource_id: str, device_security_group_name: str, **kwargs: Any) params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -306,7 +306,7 @@ def get(self, resource_id: str, device_security_group_name: str, **kwargs: Any) return deserialized - get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}"} # type: ignore + get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}"} @overload def create_or_update( @@ -404,9 +404,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DeviceSecurityGroup] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DeviceSecurityGroup] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -428,9 +428,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -447,11 +447,13 @@ def create_or_update( deserialized = self._deserialize("DeviceSecurityGroup", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}"} # type: ignore + create_or_update.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -480,8 +482,8 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_id=resource_id, @@ -492,9 +494,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -507,4 +509,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}"} # type: ignore + delete.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_iot_security_solution_analytics_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_iot_security_solution_analytics_operations.py index 4388c6b46011..949a677a614b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_iot_security_solution_analytics_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_iot_security_solution_analytics_operations.py @@ -45,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_request( "solutionName": _SERIALIZER.url("solution_name", solution_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -78,7 +78,7 @@ def build_get_request(resource_group_name: str, solution_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_get_request(resource_group_name: str, solution_name: str, subscription "solutionName": _SERIALIZER.url("solution_name", solution_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -153,8 +153,8 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecuritySolutionAnalyticsModelList] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecuritySolutionAnalyticsModelList] = kwargs.pop("cls", None) request = build_list_request( resource_group_name=resource_group_name, @@ -166,9 +166,9 @@ def list( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -185,7 +185,9 @@ def list( return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels" + } @distributed_trace def get( @@ -214,8 +216,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecuritySolutionAnalyticsModel] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecuritySolutionAnalyticsModel] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -227,9 +229,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -246,4 +248,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_iot_security_solution_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_iot_security_solution_operations.py index 51e5cf8b82f6..c03582b6c8a0 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_iot_security_solution_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_iot_security_solution_operations.py @@ -47,7 +47,7 @@ def build_list_by_subscription_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_by_subscription_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -79,7 +79,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 = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_list_by_resource_group_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -113,7 +113,7 @@ def build_get_request(resource_group_name: str, solution_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +131,7 @@ def build_get_request(resource_group_name: str, solution_name: str, subscription "solutionName": _SERIALIZER.url("solution_name", solution_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -148,8 +148,8 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -167,7 +167,7 @@ def build_create_or_update_request( "solutionName": _SERIALIZER.url("solution_name", solution_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -186,8 +186,8 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +205,7 @@ def build_update_request( "solutionName": _SERIALIZER.url("solution_name", solution_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -224,7 +224,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -242,7 +242,7 @@ def build_delete_request( "solutionName": _SERIALIZER.url("solution_name", solution_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -291,8 +291,8 @@ def list_by_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecuritySolutionsList] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecuritySolutionsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -314,7 +314,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -330,7 +330,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -338,13 +338,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("IoTSecuritySolutionsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -357,7 +357,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions" + } @distributed_trace def list_by_resource_group( @@ -381,8 +383,8 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecuritySolutionsList] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecuritySolutionsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -405,7 +407,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -421,7 +423,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -429,13 +431,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("IoTSecuritySolutionsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -448,7 +450,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions" + } @distributed_trace def get(self, resource_group_name: str, solution_name: str, **kwargs: Any) -> _models.IoTSecuritySolutionModel: @@ -475,8 +479,8 @@ def get(self, resource_group_name: str, solution_name: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecuritySolutionModel] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecuritySolutionModel] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -488,9 +492,9 @@ def get(self, resource_group_name: str, solution_name: str, **kwargs: Any) -> _m params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -507,7 +511,9 @@ def get(self, resource_group_name: str, solution_name: str, **kwargs: Any) -> _m return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}" + } @overload def create_or_update( @@ -604,9 +610,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecuritySolutionModel] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IoTSecuritySolutionModel] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -629,9 +635,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -648,11 +654,13 @@ def create_or_update( deserialized = self._deserialize("IoTSecuritySolutionModel", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}" + } @overload def update( @@ -752,9 +760,9 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecuritySolutionModel] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IoTSecuritySolutionModel] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -777,9 +785,9 @@ def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -796,7 +804,9 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -825,8 +835,8 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -838,9 +848,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -853,4 +863,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py index bee10b9a1908..f953883c6126 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_iot_security_solutions_analytics_aggregated_alert_operations.py @@ -47,7 +47,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_list_request( "solutionName": _SERIALIZER.url("solution_name", solution_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -84,7 +84,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +103,7 @@ def build_get_request( "aggregatedAlertName": _SERIALIZER.url("aggregated_alert_name", aggregated_alert_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -120,7 +120,7 @@ def build_dismiss_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +139,7 @@ def build_dismiss_request( "aggregatedAlertName": _SERIALIZER.url("aggregated_alert_name", aggregated_alert_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -192,8 +192,8 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecurityAggregatedAlertList] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecurityAggregatedAlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -217,7 +217,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -233,7 +233,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -241,13 +241,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("IoTSecurityAggregatedAlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -260,7 +260,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts" + } @distributed_trace def get( @@ -292,8 +294,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecurityAggregatedAlert] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecurityAggregatedAlert] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -306,9 +308,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -325,7 +327,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}" + } @distributed_trace def dismiss( # pylint: disable=inconsistent-return-statements @@ -356,8 +360,8 @@ def dismiss( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_dismiss_request( resource_group_name=resource_group_name, @@ -370,9 +374,9 @@ def dismiss( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -385,4 +389,6 @@ def dismiss( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - dismiss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}/dismiss"} # type: ignore + dismiss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}/dismiss" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_iot_security_solutions_analytics_recommendation_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_iot_security_solutions_analytics_recommendation_operations.py index c29f12f7c3b0..c143feaa349b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_iot_security_solutions_analytics_recommendation_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/operations/_iot_security_solutions_analytics_recommendation_operations.py @@ -51,7 +51,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +72,7 @@ def build_get_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -89,7 +89,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +107,7 @@ def build_list_request( "solutionName": _SERIALIZER.url("solution_name", solution_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -170,8 +170,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecurityAggregatedRecommendation] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecurityAggregatedRecommendation] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -184,9 +184,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -203,7 +203,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}" + } @distributed_trace def list( @@ -229,8 +231,8 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: Literal["2019-08-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IoTSecurityAggregatedRecommendationList] + api_version: Literal["2019-08-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) + cls: ClsType[_models.IoTSecurityAggregatedRecommendationList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -254,7 +256,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -270,7 +272,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -278,13 +280,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("IoTSecurityAggregatedRecommendationList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -297,4 +299,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_configuration.py index fa080065851b..64f740d2b832 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-01-01") # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", "2020-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_metadata.json index ba0549615a76..cde054712256 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_security_center.py index cfe27e5eb433..5ec55d181902 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ( @@ -106,7 +106,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -172,15 +172,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/_configuration.py index 9847128e0ae1..f80d5f1e3b1c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-01-01") # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", "2020-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/_security_center.py index bffa59af0435..d36174c148e7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ( @@ -106,7 +106,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/__init__.py index 8f44c7940e4b..d0f4c9a78a25 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/__init__.py @@ -23,7 +23,7 @@ from ._security_solutions_operations import SecuritySolutionsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_adaptive_application_controls_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_adaptive_application_controls_operations.py index bfd1f3c2973c..dfa4ac91e899 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_adaptive_application_controls_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_adaptive_application_controls_operations.py @@ -86,8 +86,8 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdaptiveApplicationControlGroups] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.AdaptiveApplicationControlGroups] = kwargs.pop("cls", None) request = build_list_request( subscription_id=self._config.subscription_id, @@ -99,9 +99,9 @@ async def list( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -118,7 +118,7 @@ async def list( return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings"} @distributed_trace_async async def get(self, asc_location: str, group_name: str, **kwargs: Any) -> _models.AdaptiveApplicationControlGroup: @@ -145,8 +145,8 @@ async def get(self, asc_location: str, group_name: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdaptiveApplicationControlGroup] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.AdaptiveApplicationControlGroup] = kwargs.pop("cls", None) request = build_get_request( asc_location=asc_location, @@ -158,9 +158,9 @@ async def get(self, asc_location: str, group_name: str, **kwargs: Any) -> _model params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -177,7 +177,9 @@ async def get(self, asc_location: str, group_name: str, **kwargs: Any) -> _model return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}" + } @overload async def put( @@ -265,9 +267,9 @@ async def put( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdaptiveApplicationControlGroup] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AdaptiveApplicationControlGroup] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -290,9 +292,9 @@ async def put( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -309,7 +311,9 @@ async def put( return deserialized - put.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}"} # type: ignore + put.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -338,8 +342,8 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( asc_location=asc_location, @@ -351,9 +355,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -366,4 +370,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_adaptive_network_hardenings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_adaptive_network_hardenings_operations.py index 42a8ec4659a4..1c19f0573396 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_adaptive_network_hardenings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_adaptive_network_hardenings_operations.py @@ -89,8 +89,8 @@ def list_by_extended_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdaptiveNetworkHardeningsList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.AdaptiveNetworkHardeningsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -115,7 +115,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -131,7 +131,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -139,13 +139,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AdaptiveNetworkHardeningsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -158,7 +158,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_extended_resource.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings"} # type: ignore + list_by_extended_resource.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings" + } @distributed_trace_async async def get( @@ -200,8 +202,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdaptiveNetworkHardening] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.AdaptiveNetworkHardening] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -216,9 +218,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -235,7 +237,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}" + } async def _enforce_initial( # pylint: disable=inconsistent-return-statements self, @@ -258,12 +262,12 @@ async def _enforce_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - adaptive_network_hardening_enforce_action = kwargs.pop( + adaptive_network_hardening_enforce_action: Literal["enforce"] = kwargs.pop( "adaptive_network_hardening_enforce_action", "enforce" - ) # type: Literal["enforce"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + 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 @@ -290,9 +294,9 @@ async def _enforce_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -305,7 +309,9 @@ async def _enforce_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _enforce_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}"} # type: ignore + _enforce_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}" + } @overload async def begin_enforce( @@ -455,15 +461,15 @@ async def begin_enforce( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - adaptive_network_hardening_enforce_action = kwargs.pop( + adaptive_network_hardening_enforce_action: Literal["enforce"] = kwargs.pop( "adaptive_network_hardening_enforce_action", "enforce" - ) # type: Literal["enforce"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._enforce_initial( # type: ignore resource_group_name=resource_group_name, @@ -487,7 +493,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -499,6 +505,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_enforce.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}"} # type: ignore + begin_enforce.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_allowed_connections_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_allowed_connections_operations.py index cb341ce95ec9..09cec20e976e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_allowed_connections_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_allowed_connections_operations.py @@ -76,8 +76,8 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.AllowedConnectionsResour _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AllowedConnectionsList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.AllowedConnectionsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -98,7 +98,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -114,7 +114,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -122,13 +122,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AllowedConnectionsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -141,7 +141,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections"} @distributed_trace def list_by_home_region( @@ -162,8 +162,8 @@ def list_by_home_region( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AllowedConnectionsList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.AllowedConnectionsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -185,7 +185,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -201,7 +201,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -209,13 +209,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AllowedConnectionsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -228,7 +228,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_home_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections"} # type: ignore + list_by_home_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections" + } @distributed_trace_async async def get( @@ -266,8 +268,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AllowedConnectionsResource] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.AllowedConnectionsResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -280,9 +282,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -299,4 +301,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_assessments_metadata_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_assessments_metadata_operations.py index e6ac957eedaa..a3f1e54db1fb 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_assessments_metadata_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_assessments_metadata_operations.py @@ -79,8 +79,8 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.SecurityAssessmentMetada _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadataList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecurityAssessmentMetadataList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -100,7 +100,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -116,7 +116,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -124,13 +124,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityAssessmentMetadataList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -143,7 +143,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.Security/assessmentMetadata"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Security/assessmentMetadata"} @distributed_trace_async async def get(self, assessment_metadata_name: str, **kwargs: Any) -> _models.SecurityAssessmentMetadata: @@ -168,8 +168,8 @@ async def get(self, assessment_metadata_name: str, **kwargs: Any) -> _models.Sec _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadata] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecurityAssessmentMetadata] = kwargs.pop("cls", None) request = build_get_request( assessment_metadata_name=assessment_metadata_name, @@ -179,9 +179,9 @@ async def get(self, assessment_metadata_name: str, **kwargs: Any) -> _models.Sec params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -198,7 +198,7 @@ async def get(self, assessment_metadata_name: str, **kwargs: Any) -> _models.Sec return deserialized - get.metadata = {"url": "/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} # type: ignore + get.metadata = {"url": "/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SecurityAssessmentMetadata"]: @@ -214,8 +214,8 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Security _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadataList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecurityAssessmentMetadataList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -236,7 +236,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -252,7 +252,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -260,13 +260,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityAssessmentMetadataList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -279,7 +279,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata" + } @distributed_trace_async async def get_in_subscription( @@ -306,8 +308,8 @@ async def get_in_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadata] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecurityAssessmentMetadata] = kwargs.pop("cls", None) request = build_get_in_subscription_request( assessment_metadata_name=assessment_metadata_name, @@ -318,9 +320,9 @@ async def get_in_subscription( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -337,7 +339,9 @@ async def get_in_subscription( return deserialized - get_in_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} # type: ignore + get_in_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}" + } @overload async def create_in_subscription( @@ -424,9 +428,9 @@ async def create_in_subscription( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadata] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityAssessmentMetadata] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -448,9 +452,9 @@ async def create_in_subscription( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -467,7 +471,9 @@ async def create_in_subscription( return deserialized - create_in_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} # type: ignore + create_in_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}" + } @distributed_trace_async async def delete_in_subscription( # pylint: disable=inconsistent-return-statements @@ -495,8 +501,8 @@ async def delete_in_subscription( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_in_subscription_request( assessment_metadata_name=assessment_metadata_name, @@ -507,9 +513,9 @@ async def delete_in_subscription( # pylint: disable=inconsistent-return-stateme params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -522,4 +528,6 @@ async def delete_in_subscription( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - delete_in_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} # type: ignore + delete_in_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_assessments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_assessments_operations.py index 1761db658ea4..d0d36c0f9057 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_assessments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_assessments_operations.py @@ -80,8 +80,8 @@ def list(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.SecurityAsse _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecurityAssessmentList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -102,7 +102,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -118,7 +118,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -126,13 +126,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityAssessmentList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -145,7 +145,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments"} @distributed_trace_async async def get( @@ -180,8 +180,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessment] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecurityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_id=resource_id, @@ -193,9 +193,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -212,7 +212,7 @@ async def get( return deserialized - get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} # type: ignore + get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} @overload async def create_or_update( @@ -303,9 +303,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessment] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -327,9 +327,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -346,11 +346,11 @@ async def create_or_update( deserialized = self._deserialize("SecurityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} # type: ignore + create_or_update.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -379,8 +379,8 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_id=resource_id, @@ -391,9 +391,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -406,4 +406,4 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} # type: ignore + delete.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_discovered_security_solutions_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_discovered_security_solutions_operations.py index 48d2baa9aead..68dcc7918ed6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_discovered_security_solutions_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_discovered_security_solutions_operations.py @@ -76,8 +76,8 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.DiscoveredSecuritySoluti _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiscoveredSecuritySolutionList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.DiscoveredSecuritySolutionList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -98,7 +98,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -114,7 +114,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -122,13 +122,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DiscoveredSecuritySolutionList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -141,7 +141,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/discoveredSecuritySolutions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/discoveredSecuritySolutions"} @distributed_trace def list_by_home_region( @@ -162,8 +162,8 @@ def list_by_home_region( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiscoveredSecuritySolutionList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.DiscoveredSecuritySolutionList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -185,7 +185,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -201,7 +201,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -209,13 +209,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("DiscoveredSecuritySolutionList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -228,7 +228,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_home_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions"} # type: ignore + list_by_home_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions" + } @distributed_trace_async async def get( @@ -260,8 +262,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiscoveredSecuritySolution] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.DiscoveredSecuritySolution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -274,9 +276,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -293,4 +295,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_external_security_solutions_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_external_security_solutions_operations.py index 180037abff08..e49da1c7c58c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_external_security_solutions_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_external_security_solutions_operations.py @@ -76,8 +76,8 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ExternalSecuritySolution _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExternalSecuritySolutionList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.ExternalSecuritySolutionList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -98,7 +98,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -114,7 +114,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -122,13 +122,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ExternalSecuritySolutionList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -141,7 +141,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/externalSecuritySolutions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/externalSecuritySolutions"} @distributed_trace def list_by_home_region( @@ -162,8 +162,8 @@ def list_by_home_region( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExternalSecuritySolutionList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.ExternalSecuritySolutionList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -185,7 +185,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -201,7 +201,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -209,13 +209,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ExternalSecuritySolutionList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -228,7 +228,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_home_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions"} # type: ignore + list_by_home_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions" + } @distributed_trace_async async def get( @@ -260,8 +262,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExternalSecuritySolution] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.ExternalSecuritySolution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -274,9 +276,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -293,4 +295,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_jit_network_access_policies_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_jit_network_access_policies_operations.py index d5a6f0671157..330ca3f8b064 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_jit_network_access_policies_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_jit_network_access_policies_operations.py @@ -81,8 +81,8 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.JitNetworkAccessPolicy"] _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JitNetworkAccessPoliciesList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.JitNetworkAccessPoliciesList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -103,7 +103,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -119,7 +119,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -127,13 +127,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("JitNetworkAccessPoliciesList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -146,7 +146,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/jitNetworkAccessPolicies"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/jitNetworkAccessPolicies"} @distributed_trace def list_by_region(self, asc_location: str, **kwargs: Any) -> AsyncIterable["_models.JitNetworkAccessPolicy"]: @@ -166,8 +166,8 @@ def list_by_region(self, asc_location: str, **kwargs: Any) -> AsyncIterable["_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JitNetworkAccessPoliciesList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.JitNetworkAccessPoliciesList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -189,7 +189,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -205,7 +205,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -213,13 +213,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("JitNetworkAccessPoliciesList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -232,7 +232,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies"} # type: ignore + list_by_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies" + } @distributed_trace def list_by_resource_group( @@ -254,8 +256,8 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JitNetworkAccessPoliciesList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.JitNetworkAccessPoliciesList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -277,7 +279,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -293,7 +295,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -301,13 +303,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("JitNetworkAccessPoliciesList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -320,7 +322,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies" + } @distributed_trace def list_by_resource_group_and_region( @@ -345,8 +349,8 @@ def list_by_resource_group_and_region( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JitNetworkAccessPoliciesList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.JitNetworkAccessPoliciesList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -369,7 +373,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -385,7 +389,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -393,13 +397,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("JitNetworkAccessPoliciesList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -412,7 +416,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group_and_region.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies"} # type: ignore + list_by_resource_group_and_region.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies" + } @distributed_trace_async async def get( @@ -446,8 +452,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JitNetworkAccessPolicy] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.JitNetworkAccessPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -460,9 +466,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -479,7 +485,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}" + } @overload async def create_or_update( @@ -588,9 +596,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JitNetworkAccessPolicy] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JitNetworkAccessPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -614,9 +622,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -633,7 +641,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -666,8 +676,8 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -680,9 +690,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -695,7 +705,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}" + } @overload async def initiate( @@ -816,12 +828,12 @@ async def initiate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - jit_network_access_policy_initiate_type = kwargs.pop( + jit_network_access_policy_initiate_type: Literal["initiate"] = kwargs.pop( "jit_network_access_policy_initiate_type", "initiate" - ) # type: Literal["initiate"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JitNetworkAccessRequest] + ) + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JitNetworkAccessRequest] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -846,9 +858,9 @@ async def initiate( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -865,4 +877,6 @@ async def initiate( return deserialized - initiate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}/{jitNetworkAccessPolicyInitiateType}"} # type: ignore + initiate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}/{jitNetworkAccessPolicyInitiateType}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_secure_score_control_definitions_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_secure_score_control_definitions_operations.py index 1666c3f2a99e..a9a7d7af47e4 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_secure_score_control_definitions_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_secure_score_control_definitions_operations.py @@ -74,8 +74,8 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.SecureScoreControlDefini _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecureScoreControlDefinitionList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecureScoreControlDefinitionList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -95,7 +95,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -111,7 +111,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -119,13 +119,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecureScoreControlDefinitionList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -138,7 +138,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.Security/secureScoreControlDefinitions"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Security/secureScoreControlDefinitions"} @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SecureScoreControlDefinitionItem"]: @@ -155,8 +155,8 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SecureSc _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecureScoreControlDefinitionList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecureScoreControlDefinitionList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -177,7 +177,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -193,7 +193,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -201,13 +201,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecureScoreControlDefinitionList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -220,4 +220,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_secure_score_controls_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_secure_score_controls_operations.py index d935cbe380ac..7c34c6c9b877 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_secure_score_controls_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_secure_score_controls_operations.py @@ -78,8 +78,8 @@ def list_by_secure_score( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecureScoreControlList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecureScoreControlList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -102,7 +102,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -118,7 +118,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -126,13 +126,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecureScoreControlList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -145,7 +145,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_secure_score.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}/secureScoreControls"} # type: ignore + list_by_secure_score.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}/secureScoreControls" + } @distributed_trace def list( @@ -165,8 +167,8 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecureScoreControlList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecureScoreControlList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -188,7 +190,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -204,7 +206,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -212,13 +214,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecureScoreControlList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -231,4 +233,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControls"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControls"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_secure_scores_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_secure_scores_operations.py index c4821406dd76..eef4aa404d3c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_secure_scores_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_secure_scores_operations.py @@ -72,8 +72,8 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.SecureScoreItem"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecureScoresList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecureScoresList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -94,7 +94,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -110,7 +110,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -118,13 +118,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecureScoresList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -137,7 +137,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores"} @distributed_trace_async async def get(self, secure_score_name: str, **kwargs: Any) -> _models.SecureScoreItem: @@ -163,8 +163,8 @@ async def get(self, secure_score_name: str, **kwargs: Any) -> _models.SecureScor _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecureScoreItem] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecureScoreItem] = kwargs.pop("cls", None) request = build_get_request( secure_score_name=secure_score_name, @@ -175,9 +175,9 @@ async def get(self, secure_score_name: str, **kwargs: Any) -> _models.SecureScor params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -194,4 +194,6 @@ async def get(self, secure_score_name: str, **kwargs: Any) -> _models.SecureScor return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_security_solutions_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_security_solutions_operations.py index dd8c2bd37cad..3424b3848fce 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_security_solutions_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_security_solutions_operations.py @@ -71,8 +71,8 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.SecuritySolution"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecuritySolutionList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecuritySolutionList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -93,7 +93,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -109,7 +109,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -117,13 +117,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecuritySolutionList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -136,7 +136,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutions"} @distributed_trace_async async def get( @@ -168,8 +168,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecuritySolution] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecuritySolution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -182,9 +182,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -201,4 +201,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_security_solutions_reference_data_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_security_solutions_reference_data_operations.py index 5e79c73762c7..3e018804af72 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_security_solutions_reference_data_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_security_solutions_reference_data_operations.py @@ -78,8 +78,8 @@ async def list(self, **kwargs: Any) -> _models.SecuritySolutionsReferenceDataLis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecuritySolutionsReferenceDataList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecuritySolutionsReferenceDataList] = kwargs.pop("cls", None) request = build_list_request( subscription_id=self._config.subscription_id, @@ -89,9 +89,9 @@ async def list(self, **kwargs: Any) -> _models.SecuritySolutionsReferenceDataLis params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -108,7 +108,9 @@ async def list(self, **kwargs: Any) -> _models.SecuritySolutionsReferenceDataLis return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutionsReferenceData"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutionsReferenceData" + } @distributed_trace_async async def list_by_home_region(self, asc_location: str, **kwargs: Any) -> _models.SecuritySolutionsReferenceDataList: @@ -133,8 +135,8 @@ async def list_by_home_region(self, asc_location: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecuritySolutionsReferenceDataList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecuritySolutionsReferenceDataList] = kwargs.pop("cls", None) request = build_list_by_home_region_request( asc_location=asc_location, @@ -145,9 +147,9 @@ async def list_by_home_region(self, asc_location: str, **kwargs: Any) -> _models params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -164,4 +166,6 @@ async def list_by_home_region(self, asc_location: str, **kwargs: Any) -> _models return deserialized - list_by_home_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutionsReferenceData"} # type: ignore + list_by_home_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutionsReferenceData" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_server_vulnerability_assessment_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_server_vulnerability_assessment_operations.py index 3b7016783df2..53e820321c65 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_server_vulnerability_assessment_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_server_vulnerability_assessment_operations.py @@ -93,8 +93,8 @@ async def list_by_extended_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessmentsList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.ServerVulnerabilityAssessmentsList] = kwargs.pop("cls", None) request = build_list_by_extended_resource_request( resource_group_name=resource_group_name, @@ -108,9 +108,9 @@ async def list_by_extended_resource( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -127,7 +127,9 @@ async def list_by_extended_resource( return deserialized - list_by_extended_resource.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments"} # type: ignore + list_by_extended_resource.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments" + } @distributed_trace_async async def get( @@ -164,11 +166,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - server_vulnerability_assessment = kwargs.pop( - "server_vulnerability_assessment", "default" - ) # type: Literal["default"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessment] + server_vulnerability_assessment: Literal["default"] = kwargs.pop("server_vulnerability_assessment", "default") + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -183,9 +183,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -202,7 +202,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}" + } @distributed_trace_async async def create_or_update( @@ -240,11 +242,9 @@ async def create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - server_vulnerability_assessment = kwargs.pop( - "server_vulnerability_assessment", "default" - ) # type: Literal["default"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessment] + server_vulnerability_assessment: Literal["default"] = kwargs.pop("server_vulnerability_assessment", "default") + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -259,9 +259,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -278,7 +278,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}" + } async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_namespace: str, resource_type: str, resource_name: str, **kwargs: Any @@ -294,11 +296,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - server_vulnerability_assessment = kwargs.pop( - "server_vulnerability_assessment", "default" - ) # type: Literal["default"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + server_vulnerability_assessment: Literal["default"] = kwargs.pop("server_vulnerability_assessment", "default") + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -313,9 +313,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -328,7 +328,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}" + } @distributed_trace_async async def begin_delete( @@ -364,14 +366,12 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - server_vulnerability_assessment = kwargs.pop( - "server_vulnerability_assessment", "default" - ) # type: Literal["default"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + server_vulnerability_assessment: Literal["default"] = kwargs.pop("server_vulnerability_assessment", "default") + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -392,9 +392,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -406,6 +406,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_topology_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_topology_operations.py index 8568c81fb33c..bd94c2a441b3 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_topology_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/aio/operations/_topology_operations.py @@ -71,8 +71,8 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.TopologyResource"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TopologyList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.TopologyList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -93,7 +93,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -109,7 +109,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -117,13 +117,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("TopologyList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -136,7 +136,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies"} @distributed_trace def list_by_home_region(self, asc_location: str, **kwargs: Any) -> AsyncIterable["_models.TopologyResource"]: @@ -154,8 +154,8 @@ def list_by_home_region(self, asc_location: str, **kwargs: Any) -> AsyncIterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TopologyList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.TopologyList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -177,7 +177,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -193,7 +193,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -201,13 +201,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("TopologyList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -220,7 +220,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_home_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topologies"} # type: ignore + list_by_home_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topologies" + } @distributed_trace_async async def get( @@ -252,8 +254,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TopologyResource] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.TopologyResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -266,9 +268,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -285,4 +287,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/models/__init__.py index 22cb443808b0..696464205ce0 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/models/__init__.py @@ -118,7 +118,7 @@ from ._security_center_enums import TransportProtocol from ._security_center_enums import UserImpact from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/models/_models_py3.py index f912e7b9bdda..40b5ef320c48 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/models/_models_py3.py @@ -908,7 +908,7 @@ class ResourceDetails(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.source = None # type: Optional[str] + self.source: Optional[str] = None class AzureResourceDetails(ResourceDetails): @@ -938,7 +938,7 @@ class AzureResourceDetails(ResourceDetails): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.source = "Azure" # type: str + self.source: str = "Azure" self.id = None @@ -2014,7 +2014,7 @@ def __init__(self, *, workspace_id: str, vmuuid: str, source_computer_id: str, m :paramtype machine_name: str """ super().__init__(**kwargs) - self.source = "OnPremise" # type: str + self.source: str = "OnPremise" self.workspace_id = workspace_id self.vmuuid = vmuuid self.source_computer_id = source_computer_id @@ -2095,7 +2095,7 @@ def __init__( machine_name=machine_name, **kwargs ) - self.source = "OnPremiseSql" # type: str + self.source: str = "OnPremiseSql" self.server_name = server_name self.database_name = database_name diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/__init__.py index 8f44c7940e4b..d0f4c9a78a25 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/__init__.py @@ -23,7 +23,7 @@ from ._security_solutions_operations import SecuritySolutionsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_adaptive_application_controls_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_adaptive_application_controls_operations.py index fff0749da585..d4eae95f37cb 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_adaptive_application_controls_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_adaptive_application_controls_operations.py @@ -49,7 +49,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +62,7 @@ def build_list_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -83,7 +83,7 @@ def build_get_request(asc_location: str, group_name: str, subscription_id: str, _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +99,7 @@ def build_get_request(asc_location: str, group_name: str, subscription_id: str, "groupName": _SERIALIZER.url("group_name", group_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -114,8 +114,8 @@ def build_put_request(asc_location: str, group_name: str, subscription_id: str, _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +131,7 @@ def build_put_request(asc_location: str, group_name: str, subscription_id: str, "groupName": _SERIALIZER.url("group_name", group_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -148,7 +148,7 @@ def build_delete_request(asc_location: str, group_name: str, subscription_id: st _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +164,7 @@ def build_delete_request(asc_location: str, group_name: str, subscription_id: st "groupName": _SERIALIZER.url("group_name", group_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -220,8 +220,8 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdaptiveApplicationControlGroups] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.AdaptiveApplicationControlGroups] = kwargs.pop("cls", None) request = build_list_request( subscription_id=self._config.subscription_id, @@ -233,9 +233,9 @@ def list( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -252,7 +252,7 @@ def list( return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings"} @distributed_trace def get(self, asc_location: str, group_name: str, **kwargs: Any) -> _models.AdaptiveApplicationControlGroup: @@ -279,8 +279,8 @@ def get(self, asc_location: str, group_name: str, **kwargs: Any) -> _models.Adap _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdaptiveApplicationControlGroup] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.AdaptiveApplicationControlGroup] = kwargs.pop("cls", None) request = build_get_request( asc_location=asc_location, @@ -292,9 +292,9 @@ def get(self, asc_location: str, group_name: str, **kwargs: Any) -> _models.Adap params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -311,7 +311,9 @@ def get(self, asc_location: str, group_name: str, **kwargs: Any) -> _models.Adap return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}" + } @overload def put( @@ -399,9 +401,9 @@ def put( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdaptiveApplicationControlGroup] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AdaptiveApplicationControlGroup] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -424,9 +426,9 @@ def put( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -443,7 +445,9 @@ def put( return deserialized - put.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}"} # type: ignore + put.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -472,8 +476,8 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( asc_location=asc_location, @@ -485,9 +489,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -500,4 +504,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_adaptive_network_hardenings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_adaptive_network_hardenings_operations.py index 306da09fb4c1..d3542134e281 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_adaptive_network_hardenings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_adaptive_network_hardenings_operations.py @@ -54,7 +54,7 @@ def build_list_by_extended_resource_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,7 @@ def build_list_by_extended_resource_request( "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -97,7 +97,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +120,7 @@ def build_get_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -143,11 +143,11 @@ def build_enforce_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - adaptive_network_hardening_enforce_action = kwargs.pop( + adaptive_network_hardening_enforce_action: Literal["enforce"] = kwargs.pop( "adaptive_network_hardening_enforce_action", "enforce" - ) # type: Literal["enforce"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -173,7 +173,7 @@ def build_enforce_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -230,8 +230,8 @@ def list_by_extended_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdaptiveNetworkHardeningsList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.AdaptiveNetworkHardeningsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -256,7 +256,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -272,7 +272,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -280,13 +280,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AdaptiveNetworkHardeningsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -299,7 +299,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_extended_resource.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings"} # type: ignore + list_by_extended_resource.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings" + } @distributed_trace def get( @@ -341,8 +343,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AdaptiveNetworkHardening] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.AdaptiveNetworkHardening] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -357,9 +359,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -376,7 +378,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}" + } def _enforce_initial( # pylint: disable=inconsistent-return-statements self, @@ -399,12 +403,12 @@ def _enforce_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - adaptive_network_hardening_enforce_action = kwargs.pop( + adaptive_network_hardening_enforce_action: Literal["enforce"] = kwargs.pop( "adaptive_network_hardening_enforce_action", "enforce" - ) # type: Literal["enforce"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + 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 @@ -431,9 +435,9 @@ def _enforce_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -446,7 +450,9 @@ def _enforce_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _enforce_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}"} # type: ignore + _enforce_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}" + } @overload def begin_enforce( @@ -596,15 +602,15 @@ def begin_enforce( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - adaptive_network_hardening_enforce_action = kwargs.pop( + adaptive_network_hardening_enforce_action: Literal["enforce"] = kwargs.pop( "adaptive_network_hardening_enforce_action", "enforce" - ) # type: Literal["enforce"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._enforce_initial( # type: ignore resource_group_name=resource_group_name, @@ -628,7 +634,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -640,6 +646,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_enforce.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}"} # type: ignore + begin_enforce.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_allowed_connections_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_allowed_connections_operations.py index 6929ecb0f58a..5a8f7cd2cb3a 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_allowed_connections_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_allowed_connections_operations.py @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -71,7 +71,7 @@ def build_list_by_home_region_request(asc_location: str, subscription_id: str, * _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,7 +86,7 @@ def build_list_by_home_region_request(asc_location: str, subscription_id: str, * "ascLocation": _SERIALIZER.url("asc_location", asc_location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,7 +107,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -126,7 +126,7 @@ def build_get_request( "connectionType": _SERIALIZER.url("connection_type", connection_type, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -170,8 +170,8 @@ def list(self, **kwargs: Any) -> Iterable["_models.AllowedConnectionsResource"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AllowedConnectionsList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.AllowedConnectionsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -192,7 +192,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -208,7 +208,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -216,13 +216,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AllowedConnectionsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -235,7 +235,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections"} @distributed_trace def list_by_home_region(self, asc_location: str, **kwargs: Any) -> Iterable["_models.AllowedConnectionsResource"]: @@ -254,8 +254,8 @@ def list_by_home_region(self, asc_location: str, **kwargs: Any) -> Iterable["_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AllowedConnectionsList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.AllowedConnectionsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -277,7 +277,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -293,7 +293,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -301,13 +301,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AllowedConnectionsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -320,7 +320,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_home_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections"} # type: ignore + list_by_home_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections" + } @distributed_trace def get( @@ -358,8 +360,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AllowedConnectionsResource] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.AllowedConnectionsResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -372,9 +374,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -391,4 +393,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_assessments_metadata_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_assessments_metadata_operations.py index 437167903c12..9945f0d7e514 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_assessments_metadata_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_assessments_metadata_operations.py @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_get_request(assessment_metadata_name: str, **kwargs: Any) -> HttpReque _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_get_request(assessment_metadata_name: str, **kwargs: Any) -> HttpReque "assessmentMetadataName": _SERIALIZER.url("assessment_metadata_name", assessment_metadata_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -88,7 +88,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +99,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,7 +116,7 @@ def build_get_in_subscription_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +131,7 @@ def build_get_in_subscription_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -148,8 +148,8 @@ def build_create_in_subscription_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +164,7 @@ def build_create_in_subscription_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -183,7 +183,7 @@ def build_delete_in_subscription_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +198,7 @@ def build_delete_in_subscription_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -242,8 +242,8 @@ def list(self, **kwargs: Any) -> Iterable["_models.SecurityAssessmentMetadata"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadataList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecurityAssessmentMetadataList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -263,7 +263,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -279,7 +279,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -287,13 +287,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityAssessmentMetadataList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -306,7 +306,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.Security/assessmentMetadata"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Security/assessmentMetadata"} @distributed_trace def get(self, assessment_metadata_name: str, **kwargs: Any) -> _models.SecurityAssessmentMetadata: @@ -331,8 +331,8 @@ def get(self, assessment_metadata_name: str, **kwargs: Any) -> _models.SecurityA _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadata] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecurityAssessmentMetadata] = kwargs.pop("cls", None) request = build_get_request( assessment_metadata_name=assessment_metadata_name, @@ -342,9 +342,9 @@ def get(self, assessment_metadata_name: str, **kwargs: Any) -> _models.SecurityA params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -361,7 +361,7 @@ def get(self, assessment_metadata_name: str, **kwargs: Any) -> _models.SecurityA return deserialized - get.metadata = {"url": "/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} # type: ignore + get.metadata = {"url": "/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SecurityAssessmentMetadata"]: @@ -377,8 +377,8 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SecurityAsses _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadataList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecurityAssessmentMetadataList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -399,7 +399,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -415,7 +415,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -423,13 +423,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityAssessmentMetadataList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -442,7 +442,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata" + } @distributed_trace def get_in_subscription(self, assessment_metadata_name: str, **kwargs: Any) -> _models.SecurityAssessmentMetadata: @@ -467,8 +469,8 @@ def get_in_subscription(self, assessment_metadata_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadata] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecurityAssessmentMetadata] = kwargs.pop("cls", None) request = build_get_in_subscription_request( assessment_metadata_name=assessment_metadata_name, @@ -479,9 +481,9 @@ def get_in_subscription(self, assessment_metadata_name: str, **kwargs: Any) -> _ params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -498,7 +500,9 @@ def get_in_subscription(self, assessment_metadata_name: str, **kwargs: Any) -> _ return deserialized - get_in_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} # type: ignore + get_in_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}" + } @overload def create_in_subscription( @@ -585,9 +589,9 @@ def create_in_subscription( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadata] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityAssessmentMetadata] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -609,9 +613,9 @@ def create_in_subscription( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -628,7 +632,9 @@ def create_in_subscription( return deserialized - create_in_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} # type: ignore + create_in_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}" + } @distributed_trace def delete_in_subscription( # pylint: disable=inconsistent-return-statements @@ -656,8 +662,8 @@ def delete_in_subscription( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_in_subscription_request( assessment_metadata_name=assessment_metadata_name, @@ -668,9 +674,9 @@ def delete_in_subscription( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -683,4 +689,6 @@ def delete_in_subscription( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete_in_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} # type: ignore + delete_in_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_assessments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_assessments_operations.py index 6ed562817062..8f19640a3e02 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_assessments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_assessments_operations.py @@ -45,7 +45,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,7 +54,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -71,7 +71,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +81,7 @@ def build_get_request( "assessmentName": _SERIALIZER.url("assessment_name", assessment_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -98,8 +98,8 @@ def build_create_or_update_request(resource_id: str, assessment_name: str, **kwa _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +109,7 @@ def build_create_or_update_request(resource_id: str, assessment_name: str, **kwa "assessmentName": _SERIALIZER.url("assessment_name", assessment_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -126,7 +126,7 @@ def build_delete_request(resource_id: str, assessment_name: str, **kwargs: Any) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +136,7 @@ def build_delete_request(resource_id: str, assessment_name: str, **kwargs: Any) "assessmentName": _SERIALIZER.url("assessment_name", assessment_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -183,8 +183,8 @@ def list(self, scope: str, **kwargs: Any) -> Iterable["_models.SecurityAssessmen _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecurityAssessmentList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -205,7 +205,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -221,7 +221,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -229,13 +229,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityAssessmentList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -248,7 +248,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments"} @distributed_trace def get( @@ -283,8 +283,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessment] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecurityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_id=resource_id, @@ -296,9 +296,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -315,7 +315,7 @@ def get( return deserialized - get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} # type: ignore + get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} @overload def create_or_update( @@ -406,9 +406,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessment] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityAssessment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -430,9 +430,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -449,11 +449,11 @@ def create_or_update( deserialized = self._deserialize("SecurityAssessment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} # type: ignore + create_or_update.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -482,8 +482,8 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_id=resource_id, @@ -494,9 +494,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -509,4 +509,4 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} # type: ignore + delete.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_discovered_security_solutions_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_discovered_security_solutions_operations.py index e5fc10eda33b..2e5d99582fe2 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_discovered_security_solutions_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_discovered_security_solutions_operations.py @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,7 +73,7 @@ def build_list_by_home_region_request(asc_location: str, subscription_id: str, * _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +88,7 @@ def build_list_by_home_region_request(asc_location: str, subscription_id: str, * "ascLocation": _SERIALIZER.url("asc_location", asc_location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -109,7 +109,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -130,7 +130,7 @@ def build_get_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -174,8 +174,8 @@ def list(self, **kwargs: Any) -> Iterable["_models.DiscoveredSecuritySolution"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiscoveredSecuritySolutionList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.DiscoveredSecuritySolutionList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -196,7 +196,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -212,7 +212,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -220,13 +220,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DiscoveredSecuritySolutionList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -239,7 +239,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/discoveredSecuritySolutions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/discoveredSecuritySolutions"} @distributed_trace def list_by_home_region(self, asc_location: str, **kwargs: Any) -> Iterable["_models.DiscoveredSecuritySolution"]: @@ -258,8 +258,8 @@ def list_by_home_region(self, asc_location: str, **kwargs: Any) -> Iterable["_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiscoveredSecuritySolutionList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.DiscoveredSecuritySolutionList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -281,7 +281,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -297,7 +297,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -305,13 +305,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("DiscoveredSecuritySolutionList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -324,7 +324,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_home_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions"} # type: ignore + list_by_home_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions" + } @distributed_trace def get( @@ -356,8 +358,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.DiscoveredSecuritySolution] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.DiscoveredSecuritySolution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -370,9 +372,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -389,4 +391,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_external_security_solutions_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_external_security_solutions_operations.py index 00a0e84c865b..749008b84624 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_external_security_solutions_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_external_security_solutions_operations.py @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,7 +73,7 @@ def build_list_by_home_region_request(asc_location: str, subscription_id: str, * _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +88,7 @@ def build_list_by_home_region_request(asc_location: str, subscription_id: str, * "ascLocation": _SERIALIZER.url("asc_location", asc_location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -109,7 +109,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -130,7 +130,7 @@ def build_get_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -174,8 +174,8 @@ def list(self, **kwargs: Any) -> Iterable["_models.ExternalSecuritySolution"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExternalSecuritySolutionList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.ExternalSecuritySolutionList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -196,7 +196,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -212,7 +212,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -220,13 +220,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ExternalSecuritySolutionList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -239,7 +239,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/externalSecuritySolutions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/externalSecuritySolutions"} @distributed_trace def list_by_home_region(self, asc_location: str, **kwargs: Any) -> Iterable["_models.ExternalSecuritySolution"]: @@ -258,8 +258,8 @@ def list_by_home_region(self, asc_location: str, **kwargs: Any) -> Iterable["_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExternalSecuritySolutionList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.ExternalSecuritySolutionList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -281,7 +281,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -297,7 +297,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -305,13 +305,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ExternalSecuritySolutionList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -324,7 +324,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_home_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions"} # type: ignore + list_by_home_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions" + } @distributed_trace def get( @@ -356,8 +358,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExternalSecuritySolution] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.ExternalSecuritySolution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -370,9 +372,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -389,4 +391,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_jit_network_access_policies_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_jit_network_access_policies_operations.py index 6f6bd6431853..20dc808b38a8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_jit_network_access_policies_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_jit_network_access_policies_operations.py @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,7 +73,7 @@ def build_list_by_region_request(asc_location: str, subscription_id: str, **kwar _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +88,7 @@ def build_list_by_region_request(asc_location: str, subscription_id: str, **kwar "ascLocation": _SERIALIZER.url("asc_location", asc_location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -103,7 +103,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 = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +120,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -137,7 +137,7 @@ def build_list_by_resource_group_and_region_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,7 +155,7 @@ def build_list_by_resource_group_and_region_request( "ascLocation": _SERIALIZER.url("asc_location", asc_location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -176,7 +176,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -197,7 +197,7 @@ def build_get_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -218,8 +218,8 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -240,7 +240,7 @@ def build_create_or_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -263,7 +263,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -284,7 +284,7 @@ def build_delete_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -305,11 +305,11 @@ def build_initiate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - jit_network_access_policy_initiate_type = kwargs.pop( + jit_network_access_policy_initiate_type: Literal["initiate"] = kwargs.pop( "jit_network_access_policy_initiate_type", "initiate" - ) # type: Literal["initiate"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -333,7 +333,7 @@ def build_initiate_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -379,8 +379,8 @@ def list(self, **kwargs: Any) -> Iterable["_models.JitNetworkAccessPolicy"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JitNetworkAccessPoliciesList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.JitNetworkAccessPoliciesList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -401,7 +401,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -417,7 +417,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -425,13 +425,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("JitNetworkAccessPoliciesList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -444,7 +444,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/jitNetworkAccessPolicies"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/jitNetworkAccessPolicies"} @distributed_trace def list_by_region(self, asc_location: str, **kwargs: Any) -> Iterable["_models.JitNetworkAccessPolicy"]: @@ -464,8 +464,8 @@ def list_by_region(self, asc_location: str, **kwargs: Any) -> Iterable["_models. _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JitNetworkAccessPoliciesList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.JitNetworkAccessPoliciesList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -487,7 +487,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -503,7 +503,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -511,13 +511,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("JitNetworkAccessPoliciesList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -530,7 +530,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies"} # type: ignore + list_by_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies" + } @distributed_trace def list_by_resource_group( @@ -552,8 +554,8 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JitNetworkAccessPoliciesList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.JitNetworkAccessPoliciesList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -575,7 +577,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -591,7 +593,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -599,13 +601,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("JitNetworkAccessPoliciesList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -618,7 +620,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies" + } @distributed_trace def list_by_resource_group_and_region( @@ -643,8 +647,8 @@ def list_by_resource_group_and_region( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JitNetworkAccessPoliciesList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.JitNetworkAccessPoliciesList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -667,7 +671,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -683,7 +687,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -691,13 +695,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("JitNetworkAccessPoliciesList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -710,7 +714,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group_and_region.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies"} # type: ignore + list_by_resource_group_and_region.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies" + } @distributed_trace def get( @@ -744,8 +750,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JitNetworkAccessPolicy] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.JitNetworkAccessPolicy] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -758,9 +764,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -777,7 +783,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}" + } @overload def create_or_update( @@ -886,9 +894,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JitNetworkAccessPolicy] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JitNetworkAccessPolicy] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -912,9 +920,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -931,7 +939,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -964,8 +974,8 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -978,9 +988,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -993,7 +1003,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}" + } @overload def initiate( @@ -1114,12 +1126,12 @@ def initiate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - jit_network_access_policy_initiate_type = kwargs.pop( + jit_network_access_policy_initiate_type: Literal["initiate"] = kwargs.pop( "jit_network_access_policy_initiate_type", "initiate" - ) # type: Literal["initiate"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.JitNetworkAccessRequest] + ) + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JitNetworkAccessRequest] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -1144,9 +1156,9 @@ def initiate( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1163,4 +1175,6 @@ def initiate( return deserialized - initiate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}/{jitNetworkAccessPolicyInitiateType}"} # type: ignore + initiate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}/{jitNetworkAccessPolicyInitiateType}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_secure_score_control_definitions_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_secure_score_control_definitions_operations.py index 3bb1cbd8d86d..fb6bb747c736 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_secure_score_control_definitions_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_secure_score_control_definitions_operations.py @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -77,7 +77,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -121,8 +121,8 @@ def list(self, **kwargs: Any) -> Iterable["_models.SecureScoreControlDefinitionI _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecureScoreControlDefinitionList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecureScoreControlDefinitionList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -142,7 +142,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -158,7 +158,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -166,13 +166,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecureScoreControlDefinitionList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -185,7 +185,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.Security/secureScoreControlDefinitions"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Security/secureScoreControlDefinitions"} @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SecureScoreControlDefinitionItem"]: @@ -202,8 +202,8 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SecureScoreCo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecureScoreControlDefinitionList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecureScoreControlDefinitionList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -224,7 +224,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -240,7 +240,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -248,13 +248,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecureScoreControlDefinitionList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -267,4 +267,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_secure_score_controls_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_secure_score_controls_operations.py index e5720ed24935..8120267e2fe1 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_secure_score_controls_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_secure_score_controls_operations.py @@ -51,7 +51,7 @@ def build_list_by_secure_score_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -66,7 +66,7 @@ def build_list_by_secure_score_request( "secureScoreName": _SERIALIZER.url("secure_score_name", secure_score_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,7 +85,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_list_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,8 +151,8 @@ def list_by_secure_score( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecureScoreControlList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecureScoreControlList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -175,7 +175,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -191,7 +191,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -199,13 +199,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecureScoreControlList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -218,7 +218,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_secure_score.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}/secureScoreControls"} # type: ignore + list_by_secure_score.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}/secureScoreControls" + } @distributed_trace def list( @@ -238,8 +240,8 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecureScoreControlList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecureScoreControlList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -261,7 +263,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -277,7 +279,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -285,13 +287,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecureScoreControlList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -304,4 +306,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControls"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControls"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_secure_scores_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_secure_scores_operations.py index 42a221dadd27..b7da91e18772 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_secure_scores_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_secure_scores_operations.py @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -71,7 +71,7 @@ def build_get_request(secure_score_name: str, subscription_id: str, **kwargs: An _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_get_request(secure_score_name: str, subscription_id: str, **kwargs: An "secureScoreName": _SERIALIZER.url("secure_score_name", secure_score_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -128,8 +128,8 @@ def list(self, **kwargs: Any) -> Iterable["_models.SecureScoreItem"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecureScoresList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecureScoresList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -150,7 +150,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -166,7 +166,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -174,13 +174,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecureScoresList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -193,7 +193,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores"} @distributed_trace def get(self, secure_score_name: str, **kwargs: Any) -> _models.SecureScoreItem: @@ -219,8 +219,8 @@ def get(self, secure_score_name: str, **kwargs: Any) -> _models.SecureScoreItem: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecureScoreItem] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecureScoreItem] = kwargs.pop("cls", None) request = build_get_request( secure_score_name=secure_score_name, @@ -231,9 +231,9 @@ def get(self, secure_score_name: str, **kwargs: Any) -> _models.SecureScoreItem: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -250,4 +250,6 @@ def get(self, secure_score_name: str, **kwargs: Any) -> _models.SecureScoreItem: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_security_solutions_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_security_solutions_operations.py index d32ce7c086dd..c66f6d9e697a 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_security_solutions_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_security_solutions_operations.py @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,7 +73,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_get_request( "securitySolutionName": _SERIALIZER.url("security_solution_name", security_solution_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -134,8 +134,8 @@ def list(self, **kwargs: Any) -> Iterable["_models.SecuritySolution"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecuritySolutionList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecuritySolutionList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -156,7 +156,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -172,7 +172,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -180,13 +180,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecuritySolutionList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -199,7 +199,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutions"} @distributed_trace def get( @@ -231,8 +231,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecuritySolution] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecuritySolution] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -245,9 +245,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -264,4 +264,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_security_solutions_reference_data_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_security_solutions_reference_data_operations.py index 44d4baec6c5a..8762517d4e67 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_security_solutions_reference_data_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_security_solutions_reference_data_operations.py @@ -43,7 +43,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 = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -71,7 +71,7 @@ def build_list_by_home_region_request(asc_location: str, subscription_id: str, * _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,7 +86,7 @@ def build_list_by_home_region_request(asc_location: str, subscription_id: str, * "ascLocation": _SERIALIZER.url("asc_location", asc_location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -136,8 +136,8 @@ def list(self, **kwargs: Any) -> _models.SecuritySolutionsReferenceDataList: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecuritySolutionsReferenceDataList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecuritySolutionsReferenceDataList] = kwargs.pop("cls", None) request = build_list_request( subscription_id=self._config.subscription_id, @@ -147,9 +147,9 @@ def list(self, **kwargs: Any) -> _models.SecuritySolutionsReferenceDataList: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -166,7 +166,9 @@ def list(self, **kwargs: Any) -> _models.SecuritySolutionsReferenceDataList: return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutionsReferenceData"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutionsReferenceData" + } @distributed_trace def list_by_home_region(self, asc_location: str, **kwargs: Any) -> _models.SecuritySolutionsReferenceDataList: @@ -191,8 +193,8 @@ def list_by_home_region(self, asc_location: str, **kwargs: Any) -> _models.Secur _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecuritySolutionsReferenceDataList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.SecuritySolutionsReferenceDataList] = kwargs.pop("cls", None) request = build_list_by_home_region_request( asc_location=asc_location, @@ -203,9 +205,9 @@ def list_by_home_region(self, asc_location: str, **kwargs: Any) -> _models.Secur params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -222,4 +224,6 @@ def list_by_home_region(self, asc_location: str, **kwargs: Any) -> _models.Secur return deserialized - list_by_home_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutionsReferenceData"} # type: ignore + list_by_home_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutionsReferenceData" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_server_vulnerability_assessment_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_server_vulnerability_assessment_operations.py index f49d3fd4d88f..8be762c8dc3b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_server_vulnerability_assessment_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_server_vulnerability_assessment_operations.py @@ -52,7 +52,7 @@ def build_list_by_extended_resource_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +72,7 @@ def build_list_by_extended_resource_request( "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -94,10 +94,8 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - server_vulnerability_assessment = kwargs.pop( - "server_vulnerability_assessment", "default" - ) # type: Literal["default"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + server_vulnerability_assessment: Literal["default"] = kwargs.pop("server_vulnerability_assessment", "default") + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +118,7 @@ def build_get_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,10 +140,8 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - server_vulnerability_assessment = kwargs.pop( - "server_vulnerability_assessment", "default" - ) # type: Literal["default"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + server_vulnerability_assessment: Literal["default"] = kwargs.pop("server_vulnerability_assessment", "default") + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +164,7 @@ def build_create_or_update_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -190,10 +186,8 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - server_vulnerability_assessment = kwargs.pop( - "server_vulnerability_assessment", "default" - ) # type: Literal["default"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + server_vulnerability_assessment: Literal["default"] = kwargs.pop("server_vulnerability_assessment", "default") + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +210,7 @@ def build_delete_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -277,8 +271,8 @@ def list_by_extended_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessmentsList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.ServerVulnerabilityAssessmentsList] = kwargs.pop("cls", None) request = build_list_by_extended_resource_request( resource_group_name=resource_group_name, @@ -292,9 +286,9 @@ def list_by_extended_resource( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -311,7 +305,9 @@ def list_by_extended_resource( return deserialized - list_by_extended_resource.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments"} # type: ignore + list_by_extended_resource.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments" + } @distributed_trace def get( @@ -348,11 +344,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - server_vulnerability_assessment = kwargs.pop( - "server_vulnerability_assessment", "default" - ) # type: Literal["default"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessment] + server_vulnerability_assessment: Literal["default"] = kwargs.pop("server_vulnerability_assessment", "default") + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -367,9 +361,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -386,7 +380,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}" + } @distributed_trace def create_or_update( @@ -424,11 +420,9 @@ def create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - server_vulnerability_assessment = kwargs.pop( - "server_vulnerability_assessment", "default" - ) # type: Literal["default"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ServerVulnerabilityAssessment] + server_vulnerability_assessment: Literal["default"] = kwargs.pop("server_vulnerability_assessment", "default") + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -443,9 +437,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -462,7 +456,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}" + } def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_namespace: str, resource_type: str, resource_name: str, **kwargs: Any @@ -478,11 +474,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - server_vulnerability_assessment = kwargs.pop( - "server_vulnerability_assessment", "default" - ) # type: Literal["default"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + server_vulnerability_assessment: Literal["default"] = kwargs.pop("server_vulnerability_assessment", "default") + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -497,9 +491,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -512,7 +506,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}" + } @distributed_trace def begin_delete( @@ -548,14 +544,12 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - server_vulnerability_assessment = kwargs.pop( - "server_vulnerability_assessment", "default" - ) # type: Literal["default"] - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + server_vulnerability_assessment: Literal["default"] = kwargs.pop("server_vulnerability_assessment", "default") + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -576,9 +570,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -590,6 +584,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}"} # type: ignore + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_topology_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_topology_operations.py index c0e23166eb5f..a08384eb63e3 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_topology_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_topology_operations.py @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -71,7 +71,7 @@ def build_list_by_home_region_request(asc_location: str, subscription_id: str, * _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,7 +86,7 @@ def build_list_by_home_region_request(asc_location: str, subscription_id: str, * "ascLocation": _SERIALIZER.url("asc_location", asc_location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -103,7 +103,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -122,7 +122,7 @@ def build_get_request( "topologyResourceName": _SERIALIZER.url("topology_resource_name", topology_resource_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -164,8 +164,8 @@ def list(self, **kwargs: Any) -> Iterable["_models.TopologyResource"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TopologyList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.TopologyList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -186,7 +186,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -202,7 +202,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -210,13 +210,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("TopologyList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -229,7 +229,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies"} @distributed_trace def list_by_home_region(self, asc_location: str, **kwargs: Any) -> Iterable["_models.TopologyResource"]: @@ -246,8 +246,8 @@ def list_by_home_region(self, asc_location: str, **kwargs: Any) -> Iterable["_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TopologyList] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.TopologyList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -269,7 +269,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -285,7 +285,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -293,13 +293,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("TopologyList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -312,7 +312,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_home_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topologies"} # type: ignore + list_by_home_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topologies" + } @distributed_trace def get( @@ -344,8 +346,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: Literal["2020-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.TopologyResource] + api_version: Literal["2020-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) + cls: ClsType[_models.TopologyResource] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -358,9 +360,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -377,4 +379,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_configuration.py index 16b000307558..2291fa8addec 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-01-01-preview") # type: Literal["2020-01-01-preview"] + api_version: Literal["2020-01-01-preview"] = kwargs.pop("api_version", "2020-01-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_metadata.json index 3e2097810054..586151a08e1f 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_security_center.py index c2ef228454d9..eac66137bec7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ConnectorsOperations @@ -48,7 +48,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -76,15 +76,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/_configuration.py index 4c63533d8d8d..a264326b4945 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-01-01-preview") # type: Literal["2020-01-01-preview"] + api_version: Literal["2020-01-01-preview"] = kwargs.pop("api_version", "2020-01-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/_security_center.py index 2c1984123c43..f30d89c1d5cf 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ConnectorsOperations @@ -49,7 +49,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/operations/__init__.py index 36717e9887ca..28d52bdd565d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/operations/__init__.py @@ -9,7 +9,7 @@ from ._connectors_operations import ConnectorsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/operations/_connectors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/operations/_connectors_operations.py index e71f9e9c6b8e..889751c1a0dd 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/operations/_connectors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/aio/operations/_connectors_operations.py @@ -76,10 +76,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ConnectorSetting"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-01-01-preview") - ) # type: Literal["2020-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectorSettingList] + ) + cls: ClsType[_models.ConnectorSettingList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -100,7 +100,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -116,7 +116,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -124,13 +124,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ConnectorSettingList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -143,7 +143,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors"} @distributed_trace_async async def get(self, connector_name: str, **kwargs: Any) -> _models.ConnectorSetting: @@ -167,10 +167,10 @@ async def get(self, connector_name: str, **kwargs: Any) -> _models.ConnectorSett _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-01-01-preview") - ) # type: Literal["2020-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectorSetting] + ) + cls: ClsType[_models.ConnectorSetting] = kwargs.pop("cls", None) request = build_get_request( connector_name=connector_name, @@ -181,9 +181,9 @@ async def get(self, connector_name: str, **kwargs: Any) -> _models.ConnectorSett params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -200,7 +200,7 @@ async def get(self, connector_name: str, **kwargs: Any) -> _models.ConnectorSett return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}"} @overload async def create_or_update( @@ -281,11 +281,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-01-01-preview") - ) # type: Literal["2020-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectorSetting] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectorSetting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -307,9 +307,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -326,7 +326,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -352,10 +354,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-01-01-preview") - ) # type: Literal["2020-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( connector_name=connector_name, @@ -366,9 +368,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -381,4 +383,4 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}"} # type: ignore + delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/models/__init__.py index 4d965dbf3b31..ddfe12e9e53d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/models/__init__.py @@ -25,7 +25,7 @@ from ._security_center_enums import HybridComputeProvisioningState from ._security_center_enums import PermissionProperty from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/models/_models_py3.py index 7b508a23d1f2..78201d64381d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/models/_models_py3.py @@ -66,7 +66,7 @@ def __init__(self, **kwargs): super().__init__(**kwargs) self.authentication_provisioning_state = None self.granted_permissions = None - self.authentication_type = None # type: Optional[str] + self.authentication_type: Optional[str] = None class AwAssumeRoleAuthenticationDetailsProperties(AuthenticationDetailsProperties): @@ -126,7 +126,7 @@ def __init__(self, *, aws_assume_role_arn: str, aws_external_id: str, **kwargs): :paramtype aws_external_id: str """ super().__init__(**kwargs) - self.authentication_type = "awsAssumeRole" # type: str + self.authentication_type: str = "awsAssumeRole" self.account_id = None self.aws_assume_role_arn = aws_assume_role_arn self.aws_external_id = aws_external_id @@ -189,7 +189,7 @@ def __init__(self, *, aws_access_key_id: str, aws_secret_access_key: str, **kwar :paramtype aws_secret_access_key: str """ super().__init__(**kwargs) - self.authentication_type = "awsCreds" # type: str + self.authentication_type: str = "awsCreds" self.account_id = None self.aws_access_key_id = aws_access_key_id self.aws_secret_access_key = aws_secret_access_key @@ -515,7 +515,7 @@ def __init__( :paramtype client_x509_cert_url: str """ super().__init__(**kwargs) - self.authentication_type = "gcpCredentials" # type: str + self.authentication_type: str = "gcpCredentials" self.organization_id = organization_id self.type = type self.project_id = project_id diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/operations/__init__.py index 36717e9887ca..28d52bdd565d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/operations/__init__.py @@ -9,7 +9,7 @@ from ._connectors_operations import ConnectorsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/operations/_connectors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/operations/_connectors_operations.py index f23c32136df7..83fca6c89120 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/operations/_connectors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/operations/_connectors_operations.py @@ -45,9 +45,9 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-01-01-preview") - ) # type: Literal["2020-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,9 +73,9 @@ def build_get_request(connector_name: str, subscription_id: str, **kwargs: Any) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-01-01-preview") - ) # type: Literal["2020-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +89,7 @@ def build_get_request(connector_name: str, subscription_id: str, **kwargs: Any) "connectorName": _SERIALIZER.url("connector_name", connector_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -104,10 +104,10 @@ def build_create_or_update_request(connector_name: str, subscription_id: str, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-01-01-preview") - ) # type: Literal["2020-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,7 +121,7 @@ def build_create_or_update_request(connector_name: str, subscription_id: str, ** "connectorName": _SERIALIZER.url("connector_name", connector_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -138,9 +138,9 @@ def build_delete_request(connector_name: str, subscription_id: str, **kwargs: An _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-01-01-preview") - ) # type: Literal["2020-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +154,7 @@ def build_delete_request(connector_name: str, subscription_id: str, **kwargs: An "connectorName": _SERIALIZER.url("connector_name", connector_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,10 +197,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.ConnectorSetting"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-01-01-preview") - ) # type: Literal["2020-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectorSettingList] + ) + cls: ClsType[_models.ConnectorSettingList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -221,7 +221,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -237,7 +237,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -245,13 +245,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ConnectorSettingList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -264,7 +264,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors"} @distributed_trace def get(self, connector_name: str, **kwargs: Any) -> _models.ConnectorSetting: @@ -288,10 +288,10 @@ def get(self, connector_name: str, **kwargs: Any) -> _models.ConnectorSetting: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-01-01-preview") - ) # type: Literal["2020-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectorSetting] + ) + cls: ClsType[_models.ConnectorSetting] = kwargs.pop("cls", None) request = build_get_request( connector_name=connector_name, @@ -302,9 +302,9 @@ def get(self, connector_name: str, **kwargs: Any) -> _models.ConnectorSetting: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -321,7 +321,7 @@ def get(self, connector_name: str, **kwargs: Any) -> _models.ConnectorSetting: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}"} @overload def create_or_update( @@ -402,11 +402,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-01-01-preview") - ) # type: Literal["2020-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectorSetting] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConnectorSetting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -428,9 +428,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -447,7 +447,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}" + } @distributed_trace def delete(self, connector_name: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements @@ -471,10 +473,10 @@ def delete(self, connector_name: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-01-01-preview") - ) # type: Literal["2020-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( connector_name=connector_name, @@ -485,9 +487,9 @@ def delete(self, connector_name: str, **kwargs: Any) -> None: # pylint: disable params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -500,4 +502,4 @@ def delete(self, connector_name: str, **kwargs: Any) -> None: # pylint: disable if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}"} # type: ignore + delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_configuration.py index e26ff92bc8dd..fc405211c560 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_configuration.py @@ -40,7 +40,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-07-01-preview") # type: Literal["2020-07-01-preview"] + api_version: Literal["2020-07-01-preview"] = kwargs.pop("api_version", "2020-07-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,10 +51,7 @@ def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None: kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_metadata.json index 097b59763bc9..a6aff0ec7522 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_metadata.json @@ -36,7 +36,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -48,7 +48,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_security_center.py index fd77680bb793..54a54854ed71 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ( @@ -55,7 +55,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -91,15 +91,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/_configuration.py index b5b327f05486..78d73e6c4290 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/_configuration.py @@ -40,7 +40,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2020-07-01-preview") # type: Literal["2020-07-01-preview"] + api_version: Literal["2020-07-01-preview"] = kwargs.pop("api_version", "2020-07-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/_security_center.py index 9b2ad9c252a1..cfdbc08a0dab 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ( @@ -55,7 +55,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/operations/__init__.py index 869887473bbe..d5f860621913 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/operations/__init__.py @@ -11,7 +11,7 @@ from ._sql_vulnerability_assessment_baseline_rules_operations import SqlVulnerabilityAssessmentBaselineRulesOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/operations/_sql_vulnerability_assessment_baseline_rules_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/operations/_sql_vulnerability_assessment_baseline_rules_operations.py index 3c06e26616f4..105874af4175 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/operations/_sql_vulnerability_assessment_baseline_rules_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/operations/_sql_vulnerability_assessment_baseline_rules_operations.py @@ -166,11 +166,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RuleResults] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RuleResults] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -196,9 +196,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -215,7 +215,9 @@ async def create_or_update( return deserialized - create_or_update.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}"} # type: ignore + create_or_update.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}" + } @distributed_trace_async async def get(self, rule_id: str, workspace_id: str, resource_id: str, **kwargs: Any) -> _models.RuleResults: @@ -245,10 +247,10 @@ async def get(self, rule_id: str, workspace_id: str, resource_id: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RuleResults] + ) + cls: ClsType[_models.RuleResults] = kwargs.pop("cls", None) request = build_get_request( rule_id=rule_id, @@ -260,9 +262,9 @@ async def get(self, rule_id: str, workspace_id: str, resource_id: str, **kwargs: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -279,7 +281,9 @@ async def get(self, rule_id: str, workspace_id: str, resource_id: str, **kwargs: return deserialized - get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}"} # type: ignore + get.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -311,10 +315,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( rule_id=rule_id, @@ -326,9 +330,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -341,7 +345,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}"} # type: ignore + delete.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}" + } @distributed_trace_async async def list(self, workspace_id: str, resource_id: str, **kwargs: Any) -> _models.RulesResults: @@ -369,10 +375,10 @@ async def list(self, workspace_id: str, resource_id: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RulesResults] + ) + cls: ClsType[_models.RulesResults] = kwargs.pop("cls", None) request = build_list_request( resource_id=resource_id, @@ -383,9 +389,9 @@ async def list(self, workspace_id: str, resource_id: str, **kwargs: Any) -> _mod params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -402,7 +408,9 @@ async def list(self, workspace_id: str, resource_id: str, **kwargs: Any) -> _mod return deserialized - list.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules"} # type: ignore + list.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules" + } @overload async def add( @@ -499,11 +507,11 @@ async def add( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RulesResults] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RulesResults] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -528,9 +536,9 @@ async def add( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -547,4 +555,6 @@ async def add( return deserialized - add.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules"} # type: ignore + add.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/operations/_sql_vulnerability_assessment_scan_results_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/operations/_sql_vulnerability_assessment_scan_results_operations.py index f8a77971452d..d9f2422bc3b3 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/operations/_sql_vulnerability_assessment_scan_results_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/operations/_sql_vulnerability_assessment_scan_results_operations.py @@ -88,10 +88,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScanResult] + ) + cls: ClsType[_models.ScanResult] = kwargs.pop("cls", None) request = build_get_request( scan_id=scan_id, @@ -104,9 +104,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -123,7 +123,9 @@ async def get( return deserialized - get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults/{scanResultId}"} # type: ignore + get.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults/{scanResultId}" + } @distributed_trace_async async def list(self, scan_id: str, workspace_id: str, resource_id: str, **kwargs: Any) -> _models.ScanResults: @@ -154,10 +156,10 @@ async def list(self, scan_id: str, workspace_id: str, resource_id: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScanResults] + ) + cls: ClsType[_models.ScanResults] = kwargs.pop("cls", None) request = build_list_request( scan_id=scan_id, @@ -169,9 +171,9 @@ async def list(self, scan_id: str, workspace_id: str, resource_id: str, **kwargs params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -188,4 +190,6 @@ async def list(self, scan_id: str, workspace_id: str, resource_id: str, **kwargs return deserialized - list.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults"} # type: ignore + list.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/operations/_sql_vulnerability_assessment_scans_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/operations/_sql_vulnerability_assessment_scans_operations.py index dd43e5060c63..318bd6779198 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/operations/_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/aio/operations/_sql_vulnerability_assessment_scans_operations.py @@ -84,10 +84,10 @@ async def get(self, scan_id: str, workspace_id: str, resource_id: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Scan] + ) + cls: ClsType[_models.Scan] = kwargs.pop("cls", None) request = build_get_request( scan_id=scan_id, @@ -99,9 +99,9 @@ async def get(self, scan_id: str, workspace_id: str, resource_id: str, **kwargs: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -118,7 +118,9 @@ async def get(self, scan_id: str, workspace_id: str, resource_id: str, **kwargs: return deserialized - get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}" + } @distributed_trace_async async def list(self, workspace_id: str, resource_id: str, **kwargs: Any) -> _models.Scans: @@ -146,10 +148,10 @@ async def list(self, workspace_id: str, resource_id: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Scans] + ) + cls: ClsType[_models.Scans] = kwargs.pop("cls", None) request = build_list_request( resource_id=resource_id, @@ -160,9 +162,9 @@ async def list(self, workspace_id: str, resource_id: str, **kwargs: Any) -> _mod params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -179,4 +181,4 @@ async def list(self, workspace_id: str, resource_id: str, **kwargs: Any) -> _mod return deserialized - list.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans"} # type: ignore + list.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/models/__init__.py index 97bf09e33a17..f92a3a9e77b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/models/__init__.py @@ -33,7 +33,7 @@ from ._security_center_enums import ScanState from ._security_center_enums import ScanTriggerType from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/operations/__init__.py index 869887473bbe..d5f860621913 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/operations/__init__.py @@ -11,7 +11,7 @@ from ._sql_vulnerability_assessment_baseline_rules_operations import SqlVulnerabilityAssessmentBaselineRulesOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/operations/_sql_vulnerability_assessment_baseline_rules_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/operations/_sql_vulnerability_assessment_baseline_rules_operations.py index cfa641f0db7a..48b57983f35c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/operations/_sql_vulnerability_assessment_baseline_rules_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/operations/_sql_vulnerability_assessment_baseline_rules_operations.py @@ -43,10 +43,10 @@ def build_create_or_update_request(rule_id: str, resource_id: str, *, workspace_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_create_or_update_request(rule_id: str, resource_id: str, *, workspace_ "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["workspaceId"] = _SERIALIZER.query("workspace_id", workspace_id, "str") @@ -77,9 +77,9 @@ def build_get_request(rule_id: str, resource_id: str, *, workspace_id: str, **kw _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_get_request(rule_id: str, resource_id: str, *, workspace_id: str, **kw "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["workspaceId"] = _SERIALIZER.query("workspace_id", workspace_id, "str") @@ -108,9 +108,9 @@ def build_delete_request(rule_id: str, resource_id: str, *, workspace_id: str, * _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,7 +123,7 @@ def build_delete_request(rule_id: str, resource_id: str, *, workspace_id: str, * "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["workspaceId"] = _SERIALIZER.query("workspace_id", workspace_id, "str") @@ -139,9 +139,9 @@ def build_list_request(resource_id: str, *, workspace_id: str, **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +152,7 @@ def build_list_request(resource_id: str, *, workspace_id: str, **kwargs: Any) -> "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["workspaceId"] = _SERIALIZER.query("workspace_id", workspace_id, "str") @@ -168,10 +168,10 @@ def build_add_request(resource_id: str, *, workspace_id: str, **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +182,7 @@ def build_add_request(resource_id: str, *, workspace_id: str, **kwargs: Any) -> "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["workspaceId"] = _SERIALIZER.query("workspace_id", workspace_id, "str") @@ -320,11 +320,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RuleResults] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RuleResults] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -350,9 +350,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -369,7 +369,9 @@ def create_or_update( return deserialized - create_or_update.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}"} # type: ignore + create_or_update.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}" + } @distributed_trace def get(self, rule_id: str, workspace_id: str, resource_id: str, **kwargs: Any) -> _models.RuleResults: @@ -399,10 +401,10 @@ def get(self, rule_id: str, workspace_id: str, resource_id: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RuleResults] + ) + cls: ClsType[_models.RuleResults] = kwargs.pop("cls", None) request = build_get_request( rule_id=rule_id, @@ -414,9 +416,9 @@ def get(self, rule_id: str, workspace_id: str, resource_id: str, **kwargs: Any) params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -433,7 +435,9 @@ def get(self, rule_id: str, workspace_id: str, resource_id: str, **kwargs: Any) return deserialized - get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}"} # type: ignore + get.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -465,10 +469,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( rule_id=rule_id, @@ -480,9 +484,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -495,7 +499,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}"} # type: ignore + delete.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}" + } @distributed_trace def list(self, workspace_id: str, resource_id: str, **kwargs: Any) -> _models.RulesResults: @@ -523,10 +529,10 @@ def list(self, workspace_id: str, resource_id: str, **kwargs: Any) -> _models.Ru _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RulesResults] + ) + cls: ClsType[_models.RulesResults] = kwargs.pop("cls", None) request = build_list_request( resource_id=resource_id, @@ -537,9 +543,9 @@ def list(self, workspace_id: str, resource_id: str, **kwargs: Any) -> _models.Ru params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -556,7 +562,9 @@ def list(self, workspace_id: str, resource_id: str, **kwargs: Any) -> _models.Ru return deserialized - list.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules"} # type: ignore + list.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules" + } @overload def add( @@ -653,11 +661,11 @@ def add( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.RulesResults] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RulesResults] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -682,9 +690,9 @@ def add( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -701,4 +709,6 @@ def add( return deserialized - add.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules"} # type: ignore + add.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/operations/_sql_vulnerability_assessment_scan_results_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/operations/_sql_vulnerability_assessment_scan_results_operations.py index 7b5825a52b1e..76b4de6ccd8b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/operations/_sql_vulnerability_assessment_scan_results_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/operations/_sql_vulnerability_assessment_scan_results_operations.py @@ -45,9 +45,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_get_request( "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["workspaceId"] = _SERIALIZER.query("workspace_id", workspace_id, "str") @@ -77,9 +77,9 @@ def build_list_request(scan_id: str, resource_id: str, *, workspace_id: str, **k _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_list_request(scan_id: str, resource_id: str, *, workspace_id: str, **k "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["workspaceId"] = _SERIALIZER.query("workspace_id", workspace_id, "str") @@ -156,10 +156,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScanResult] + ) + cls: ClsType[_models.ScanResult] = kwargs.pop("cls", None) request = build_get_request( scan_id=scan_id, @@ -172,9 +172,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -191,7 +191,9 @@ def get( return deserialized - get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults/{scanResultId}"} # type: ignore + get.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults/{scanResultId}" + } @distributed_trace def list(self, scan_id: str, workspace_id: str, resource_id: str, **kwargs: Any) -> _models.ScanResults: @@ -222,10 +224,10 @@ def list(self, scan_id: str, workspace_id: str, resource_id: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ScanResults] + ) + cls: ClsType[_models.ScanResults] = kwargs.pop("cls", None) request = build_list_request( scan_id=scan_id, @@ -237,9 +239,9 @@ def list(self, scan_id: str, workspace_id: str, resource_id: str, **kwargs: Any) params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -256,4 +258,6 @@ def list(self, scan_id: str, workspace_id: str, resource_id: str, **kwargs: Any) return deserialized - list.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults"} # type: ignore + list.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/operations/_sql_vulnerability_assessment_scans_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/operations/_sql_vulnerability_assessment_scans_operations.py index 67b1fb530b27..eb26beaf8c90 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/operations/_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/operations/_sql_vulnerability_assessment_scans_operations.py @@ -43,9 +43,9 @@ def build_get_request(scan_id: str, resource_id: str, *, workspace_id: str, **kw _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,7 +57,7 @@ def build_get_request(scan_id: str, resource_id: str, *, workspace_id: str, **kw "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["workspaceId"] = _SERIALIZER.query("workspace_id", workspace_id, "str") @@ -73,9 +73,9 @@ def build_list_request(resource_id: str, *, workspace_id: str, **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,7 +86,7 @@ def build_list_request(resource_id: str, *, workspace_id: str, **kwargs: Any) -> "resourceId": _SERIALIZER.url("resource_id", resource_id, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["workspaceId"] = _SERIALIZER.query("workspace_id", workspace_id, "str") @@ -146,10 +146,10 @@ def get(self, scan_id: str, workspace_id: str, resource_id: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Scan] + ) + cls: ClsType[_models.Scan] = kwargs.pop("cls", None) request = build_get_request( scan_id=scan_id, @@ -161,9 +161,9 @@ def get(self, scan_id: str, workspace_id: str, resource_id: str, **kwargs: Any) params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -180,7 +180,9 @@ def get(self, scan_id: str, workspace_id: str, resource_id: str, **kwargs: Any) return deserialized - get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}"} # type: ignore + get.metadata = { + "url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}" + } @distributed_trace def list(self, workspace_id: str, resource_id: str, **kwargs: Any) -> _models.Scans: @@ -208,10 +210,10 @@ def list(self, workspace_id: str, resource_id: str, **kwargs: Any) -> _models.Sc _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2020-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2020-07-01-preview") - ) # type: Literal["2020-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Scans] + ) + cls: ClsType[_models.Scans] = kwargs.pop("cls", None) request = build_list_request( resource_id=resource_id, @@ -222,9 +224,9 @@ def list(self, workspace_id: str, resource_id: str, **kwargs: Any) -> _models.Sc params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -241,4 +243,4 @@ def list(self, workspace_id: str, resource_id: str, **kwargs: Any) -> _models.Sc return deserialized - list.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans"} # type: ignore + list.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_configuration.py index dc619b6e3a5e..931f3cd30b8d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-01-01") # type: Literal["2021-01-01"] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", "2021-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_metadata.json index 174825493d37..b3ddfd7ba2c5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_security_center.py index 3c5681588d3a..5bfeed8bfe19 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import AlertsOperations @@ -50,7 +50,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -78,15 +78,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/_configuration.py index e6a65f1057b1..13d4593305c6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-01-01") # type: Literal["2021-01-01"] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", "2021-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/_security_center.py index 6bee95b3d333..63fc56312a42 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import AlertsOperations @@ -50,7 +50,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/operations/__init__.py index 522898d37fc6..b3a334939bbd 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/operations/__init__.py @@ -9,7 +9,7 @@ from ._alerts_operations import AlertsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/operations/_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/operations/_alerts_operations.py index 0d4651467be4..4e8d6bdd1b1a 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/operations/_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/operations/_alerts_operations.py @@ -86,8 +86,8 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Alert"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertList] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -108,7 +108,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -124,7 +124,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -132,13 +132,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -151,7 +151,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts"} @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Alert"]: @@ -168,8 +168,8 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertList] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -191,7 +191,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -207,7 +207,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -215,13 +215,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -234,7 +234,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts" + } @distributed_trace def list_subscription_level_by_region(self, asc_location: str, **kwargs: Any) -> AsyncIterable["_models.Alert"]: @@ -252,8 +254,8 @@ def list_subscription_level_by_region(self, asc_location: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertList] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -275,7 +277,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -291,7 +293,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -299,13 +301,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -318,7 +320,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_subscription_level_by_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts"} # type: ignore + list_subscription_level_by_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts" + } @distributed_trace def list_resource_group_level_by_region( @@ -341,8 +345,8 @@ def list_resource_group_level_by_region( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertList] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -365,7 +369,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -381,7 +385,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -389,13 +393,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -408,7 +412,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_resource_group_level_by_region.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts"} # type: ignore + list_resource_group_level_by_region.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts" + } @distributed_trace_async async def get_subscription_level(self, asc_location: str, alert_name: str, **kwargs: Any) -> _models.Alert: @@ -435,8 +441,8 @@ async def get_subscription_level(self, asc_location: str, alert_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Alert] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[_models.Alert] = kwargs.pop("cls", None) request = build_get_subscription_level_request( asc_location=asc_location, @@ -448,9 +454,9 @@ async def get_subscription_level(self, asc_location: str, alert_name: str, **kwa params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -467,7 +473,9 @@ async def get_subscription_level(self, asc_location: str, alert_name: str, **kwa return deserialized - get_subscription_level.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}"} # type: ignore + get_subscription_level.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}" + } @distributed_trace_async async def get_resource_group_level( @@ -499,8 +507,8 @@ async def get_resource_group_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Alert] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[_models.Alert] = kwargs.pop("cls", None) request = build_get_resource_group_level_request( asc_location=asc_location, @@ -513,9 +521,9 @@ async def get_resource_group_level( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -532,7 +540,9 @@ async def get_resource_group_level( return deserialized - get_resource_group_level.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}"} # type: ignore + get_resource_group_level.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}" + } @distributed_trace_async async def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements @@ -561,8 +571,8 @@ async def update_subscription_level_state_to_dismiss( # pylint: disable=inconsi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_subscription_level_state_to_dismiss_request( asc_location=asc_location, @@ -574,9 +584,9 @@ async def update_subscription_level_state_to_dismiss( # pylint: disable=inconsi params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -589,7 +599,9 @@ async def update_subscription_level_state_to_dismiss( # pylint: disable=inconsi if cls: return cls(pipeline_response, None, {}) - update_subscription_level_state_to_dismiss.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss"} # type: ignore + update_subscription_level_state_to_dismiss.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss" + } @distributed_trace_async async def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent-return-statements @@ -618,8 +630,8 @@ async def update_subscription_level_state_to_resolve( # pylint: disable=inconsi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_subscription_level_state_to_resolve_request( asc_location=asc_location, @@ -631,9 +643,9 @@ async def update_subscription_level_state_to_resolve( # pylint: disable=inconsi params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -646,7 +658,9 @@ async def update_subscription_level_state_to_resolve( # pylint: disable=inconsi if cls: return cls(pipeline_response, None, {}) - update_subscription_level_state_to_resolve.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve"} # type: ignore + update_subscription_level_state_to_resolve.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve" + } @distributed_trace_async async def update_subscription_level_state_to_activate( # pylint: disable=inconsistent-return-statements @@ -675,8 +689,8 @@ async def update_subscription_level_state_to_activate( # pylint: disable=incons _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_subscription_level_state_to_activate_request( asc_location=asc_location, @@ -688,9 +702,9 @@ async def update_subscription_level_state_to_activate( # pylint: disable=incons params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -703,7 +717,9 @@ async def update_subscription_level_state_to_activate( # pylint: disable=incons if cls: return cls(pipeline_response, None, {}) - update_subscription_level_state_to_activate.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate"} # type: ignore + update_subscription_level_state_to_activate.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate" + } @distributed_trace_async async def update_resource_group_level_state_to_resolve( # pylint: disable=inconsistent-return-statements @@ -735,8 +751,8 @@ async def update_resource_group_level_state_to_resolve( # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_resource_group_level_state_to_resolve_request( asc_location=asc_location, @@ -749,9 +765,9 @@ async def update_resource_group_level_state_to_resolve( # pylint: disable=incon params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -764,7 +780,9 @@ async def update_resource_group_level_state_to_resolve( # pylint: disable=incon if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_state_to_resolve.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve"} # type: ignore + update_resource_group_level_state_to_resolve.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve" + } @distributed_trace_async async def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements @@ -796,8 +814,8 @@ async def update_resource_group_level_state_to_dismiss( # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_resource_group_level_state_to_dismiss_request( asc_location=asc_location, @@ -810,9 +828,9 @@ async def update_resource_group_level_state_to_dismiss( # pylint: disable=incon params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -825,7 +843,9 @@ async def update_resource_group_level_state_to_dismiss( # pylint: disable=incon if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_state_to_dismiss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss"} # type: ignore + update_resource_group_level_state_to_dismiss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss" + } @distributed_trace_async async def update_resource_group_level_state_to_activate( # pylint: disable=inconsistent-return-statements @@ -857,8 +877,8 @@ async def update_resource_group_level_state_to_activate( # pylint: disable=inco _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_resource_group_level_state_to_activate_request( asc_location=asc_location, @@ -871,9 +891,9 @@ async def update_resource_group_level_state_to_activate( # pylint: disable=inco params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -886,7 +906,9 @@ async def update_resource_group_level_state_to_activate( # pylint: disable=inco if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_state_to_activate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate"} # type: ignore + update_resource_group_level_state_to_activate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate" + } async def _simulate_initial( # pylint: disable=inconsistent-return-statements self, @@ -905,9 +927,9 @@ async def _simulate_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + 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 @@ -929,9 +951,9 @@ async def _simulate_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -944,7 +966,9 @@ async def _simulate_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _simulate_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate"} # type: ignore + _simulate_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate" + } @overload async def begin_simulate( @@ -1045,12 +1069,12 @@ async def begin_simulate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._simulate_initial( # type: ignore asc_location=asc_location, @@ -1069,10 +1093,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1084,6 +1108,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_simulate.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate"} # type: ignore + begin_simulate.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/models/__init__.py index 27a235f46f19..f0a4dbee8e8f 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/models/__init__.py @@ -26,7 +26,7 @@ from ._security_center_enums import KindEnum from ._security_center_enums import ResourceIdentifierType from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/models/_models_py3.py index 2518d4a817ac..5ec6d1d1c9da 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/models/_models_py3.py @@ -318,7 +318,7 @@ def __init__(self, *, additional_properties: Optional[Dict[str, Any]] = None, ** """ super().__init__(**kwargs) self.additional_properties = additional_properties - self.kind = None # type: Optional[str] + self.kind: Optional[str] = None class AlertSimulatorBundlesRequestProperties(AlertSimulatorRequestProperties): @@ -360,7 +360,7 @@ def __init__( :paramtype bundles: list[str or ~azure.mgmt.security.v2021_01_01.models.BundleType] """ super().__init__(additional_properties=additional_properties, **kwargs) - self.kind = "Bundles" # type: str + self.kind: str = "Bundles" self.bundles = bundles @@ -410,7 +410,7 @@ class ResourceIdentifier(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.type = None # type: Optional[str] + self.type: Optional[str] = None class AzureResourceIdentifier(ResourceIdentifier): @@ -440,7 +440,7 @@ class AzureResourceIdentifier(ResourceIdentifier): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.type = "AzureResource" # type: str + self.type: str = "AzureResource" self.azure_resource_id = None @@ -560,7 +560,7 @@ class LogAnalyticsIdentifier(ResourceIdentifier): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.type = "LogAnalytics" # type: str + self.type: str = "LogAnalytics" self.workspace_id = None self.workspace_subscription_id = None self.workspace_resource_group = None diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/operations/__init__.py index 522898d37fc6..b3a334939bbd 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/operations/__init__.py @@ -9,7 +9,7 @@ from ._alerts_operations import AlertsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/operations/_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/operations/_alerts_operations.py index b96170f2f9d9..ac67f844cf95 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/operations/_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/operations/_alerts_operations.py @@ -47,7 +47,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,7 +73,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 = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +90,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,7 +107,7 @@ def build_list_subscription_level_by_region_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,7 +121,7 @@ def build_list_subscription_level_by_region_request( "ascLocation": _SERIALIZER.url("asc_location", asc_location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -138,7 +138,7 @@ def build_list_resource_group_level_by_region_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -156,7 +156,7 @@ def build_list_resource_group_level_by_region_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -173,7 +173,7 @@ def build_get_subscription_level_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -189,7 +189,7 @@ def build_get_subscription_level_request( "alertName": _SERIALIZER.url("alert_name", alert_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -206,7 +206,7 @@ def build_get_resource_group_level_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -225,7 +225,7 @@ def build_get_resource_group_level_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -242,7 +242,7 @@ def build_update_subscription_level_state_to_dismiss_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -258,7 +258,7 @@ def build_update_subscription_level_state_to_dismiss_request( "alertName": _SERIALIZER.url("alert_name", alert_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -275,7 +275,7 @@ def build_update_subscription_level_state_to_resolve_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -291,7 +291,7 @@ def build_update_subscription_level_state_to_resolve_request( "alertName": _SERIALIZER.url("alert_name", alert_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -308,7 +308,7 @@ def build_update_subscription_level_state_to_activate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +324,7 @@ def build_update_subscription_level_state_to_activate_request( "alertName": _SERIALIZER.url("alert_name", alert_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -341,7 +341,7 @@ def build_update_resource_group_level_state_to_resolve_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -360,7 +360,7 @@ def build_update_resource_group_level_state_to_resolve_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -377,7 +377,7 @@ def build_update_resource_group_level_state_to_dismiss_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -396,7 +396,7 @@ def build_update_resource_group_level_state_to_dismiss_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -413,7 +413,7 @@ def build_update_resource_group_level_state_to_activate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +432,7 @@ def build_update_resource_group_level_state_to_activate_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -447,8 +447,8 @@ def build_simulate_request(asc_location: str, subscription_id: str, **kwargs: An _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -463,7 +463,7 @@ def build_simulate_request(asc_location: str, subscription_id: str, **kwargs: An "ascLocation": _SERIALIZER.url("asc_location", asc_location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -507,8 +507,8 @@ def list(self, **kwargs: Any) -> Iterable["_models.Alert"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertList] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -529,7 +529,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -545,7 +545,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -553,13 +553,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -572,7 +572,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts"} @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Alert"]: @@ -589,8 +589,8 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertList] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -612,7 +612,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -628,7 +628,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -636,13 +636,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -655,7 +655,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts" + } @distributed_trace def list_subscription_level_by_region(self, asc_location: str, **kwargs: Any) -> Iterable["_models.Alert"]: @@ -673,8 +675,8 @@ def list_subscription_level_by_region(self, asc_location: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertList] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -696,7 +698,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -712,7 +714,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -720,13 +722,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -739,7 +741,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_subscription_level_by_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts"} # type: ignore + list_subscription_level_by_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts" + } @distributed_trace def list_resource_group_level_by_region( @@ -762,8 +766,8 @@ def list_resource_group_level_by_region( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertList] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -786,7 +790,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -802,7 +806,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -810,13 +814,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -829,7 +833,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_resource_group_level_by_region.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts"} # type: ignore + list_resource_group_level_by_region.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts" + } @distributed_trace def get_subscription_level(self, asc_location: str, alert_name: str, **kwargs: Any) -> _models.Alert: @@ -856,8 +862,8 @@ def get_subscription_level(self, asc_location: str, alert_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Alert] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[_models.Alert] = kwargs.pop("cls", None) request = build_get_subscription_level_request( asc_location=asc_location, @@ -869,9 +875,9 @@ def get_subscription_level(self, asc_location: str, alert_name: str, **kwargs: A params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -888,7 +894,9 @@ def get_subscription_level(self, asc_location: str, alert_name: str, **kwargs: A return deserialized - get_subscription_level.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}"} # type: ignore + get_subscription_level.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}" + } @distributed_trace def get_resource_group_level( @@ -920,8 +928,8 @@ def get_resource_group_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Alert] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[_models.Alert] = kwargs.pop("cls", None) request = build_get_resource_group_level_request( asc_location=asc_location, @@ -934,9 +942,9 @@ def get_resource_group_level( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -953,7 +961,9 @@ def get_resource_group_level( return deserialized - get_resource_group_level.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}"} # type: ignore + get_resource_group_level.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}" + } @distributed_trace def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements @@ -982,8 +992,8 @@ def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_subscription_level_state_to_dismiss_request( asc_location=asc_location, @@ -995,9 +1005,9 @@ def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1010,7 +1020,9 @@ def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent- if cls: return cls(pipeline_response, None, {}) - update_subscription_level_state_to_dismiss.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss"} # type: ignore + update_subscription_level_state_to_dismiss.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss" + } @distributed_trace def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent-return-statements @@ -1039,8 +1051,8 @@ def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_subscription_level_state_to_resolve_request( asc_location=asc_location, @@ -1052,9 +1064,9 @@ def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1067,7 +1079,9 @@ def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent- if cls: return cls(pipeline_response, None, {}) - update_subscription_level_state_to_resolve.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve"} # type: ignore + update_subscription_level_state_to_resolve.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve" + } @distributed_trace def update_subscription_level_state_to_activate( # pylint: disable=inconsistent-return-statements @@ -1096,8 +1110,8 @@ def update_subscription_level_state_to_activate( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_subscription_level_state_to_activate_request( asc_location=asc_location, @@ -1109,9 +1123,9 @@ def update_subscription_level_state_to_activate( # pylint: disable=inconsistent params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1124,7 +1138,9 @@ def update_subscription_level_state_to_activate( # pylint: disable=inconsistent if cls: return cls(pipeline_response, None, {}) - update_subscription_level_state_to_activate.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate"} # type: ignore + update_subscription_level_state_to_activate.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate" + } @distributed_trace def update_resource_group_level_state_to_resolve( # pylint: disable=inconsistent-return-statements @@ -1156,8 +1172,8 @@ def update_resource_group_level_state_to_resolve( # pylint: disable=inconsisten _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_resource_group_level_state_to_resolve_request( asc_location=asc_location, @@ -1170,9 +1186,9 @@ def update_resource_group_level_state_to_resolve( # pylint: disable=inconsisten params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1185,7 +1201,9 @@ def update_resource_group_level_state_to_resolve( # pylint: disable=inconsisten if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_state_to_resolve.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve"} # type: ignore + update_resource_group_level_state_to_resolve.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve" + } @distributed_trace def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements @@ -1217,8 +1235,8 @@ def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsisten _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_resource_group_level_state_to_dismiss_request( asc_location=asc_location, @@ -1231,9 +1249,9 @@ def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsisten params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1246,7 +1264,9 @@ def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsisten if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_state_to_dismiss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss"} # type: ignore + update_resource_group_level_state_to_dismiss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss" + } @distributed_trace def update_resource_group_level_state_to_activate( # pylint: disable=inconsistent-return-statements @@ -1278,8 +1298,8 @@ def update_resource_group_level_state_to_activate( # pylint: disable=inconsiste _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_resource_group_level_state_to_activate_request( asc_location=asc_location, @@ -1292,9 +1312,9 @@ def update_resource_group_level_state_to_activate( # pylint: disable=inconsiste params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1307,7 +1327,9 @@ def update_resource_group_level_state_to_activate( # pylint: disable=inconsiste if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_state_to_activate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate"} # type: ignore + update_resource_group_level_state_to_activate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate" + } def _simulate_initial( # pylint: disable=inconsistent-return-statements self, @@ -1326,9 +1348,9 @@ def _simulate_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + 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 @@ -1350,9 +1372,9 @@ def _simulate_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1365,7 +1387,9 @@ def _simulate_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _simulate_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate"} # type: ignore + _simulate_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate" + } @overload def begin_simulate( @@ -1466,12 +1490,12 @@ def begin_simulate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) # type: Literal["2021-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2021-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._simulate_initial( # type: ignore asc_location=asc_location, @@ -1490,9 +1514,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1504,6 +1528,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_simulate.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate"} # type: ignore + begin_simulate.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_configuration.py index 29eb554b4669..6ed4f0ee5795 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-01-15-preview") # type: Literal["2021-01-15-preview"] + api_version: Literal["2021-01-15-preview"] = kwargs.pop("api_version", "2021-01-15-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_metadata.json index 44fe3aad2097..1346a27af4da 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_security_center.py index 4aa5c10b58ce..855e8da4368e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import IngestionSettingsOperations @@ -49,7 +49,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -79,15 +79,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/_configuration.py index ed15395c07e2..d5a61c66e7b1 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-01-15-preview") # type: Literal["2021-01-15-preview"] + api_version: Literal["2021-01-15-preview"] = kwargs.pop("api_version", "2021-01-15-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/_security_center.py index e50ff084bfd9..e6e92c0c0b5d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import IngestionSettingsOperations @@ -49,7 +49,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/operations/__init__.py index af84327affac..e0aa0c4329cb 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/operations/__init__.py @@ -9,7 +9,7 @@ from ._ingestion_settings_operations import IngestionSettingsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/operations/_ingestion_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/operations/_ingestion_settings_operations.py index 783c50fa9756..c373b19a42d7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/operations/_ingestion_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/aio/operations/_ingestion_settings_operations.py @@ -79,10 +79,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.IngestionSetting"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IngestionSettingList] + ) + cls: ClsType[_models.IngestionSettingList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -103,7 +103,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -119,7 +119,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -127,13 +127,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("IngestionSettingList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -146,7 +146,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings"} @distributed_trace_async async def get(self, ingestion_setting_name: str, **kwargs: Any) -> _models.IngestionSetting: @@ -171,10 +171,10 @@ async def get(self, ingestion_setting_name: str, **kwargs: Any) -> _models.Inges _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IngestionSetting] + ) + cls: ClsType[_models.IngestionSetting] = kwargs.pop("cls", None) request = build_get_request( ingestion_setting_name=ingestion_setting_name, @@ -185,9 +185,9 @@ async def get(self, ingestion_setting_name: str, **kwargs: Any) -> _models.Inges params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -204,7 +204,9 @@ async def get(self, ingestion_setting_name: str, **kwargs: Any) -> _models.Inges return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}" + } @overload async def create( @@ -287,11 +289,11 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IngestionSetting] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IngestionSetting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -313,9 +315,9 @@ async def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -332,7 +334,9 @@ async def create( return deserialized - create.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}"} # type: ignore + create.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -358,10 +362,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( ingestion_setting_name=ingestion_setting_name, @@ -372,9 +376,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -387,7 +391,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}" + } @distributed_trace_async async def list_tokens(self, ingestion_setting_name: str, **kwargs: Any) -> _models.IngestionSettingToken: @@ -412,10 +418,10 @@ async def list_tokens(self, ingestion_setting_name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IngestionSettingToken] + ) + cls: ClsType[_models.IngestionSettingToken] = kwargs.pop("cls", None) request = build_list_tokens_request( ingestion_setting_name=ingestion_setting_name, @@ -426,9 +432,9 @@ async def list_tokens(self, ingestion_setting_name: str, **kwargs: Any) -> _mode params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -445,7 +451,9 @@ async def list_tokens(self, ingestion_setting_name: str, **kwargs: Any) -> _mode return deserialized - list_tokens.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens"} # type: ignore + list_tokens.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens" + } @distributed_trace_async async def list_connection_strings(self, ingestion_setting_name: str, **kwargs: Any) -> _models.ConnectionStrings: @@ -469,10 +477,10 @@ async def list_connection_strings(self, ingestion_setting_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectionStrings] + ) + cls: ClsType[_models.ConnectionStrings] = kwargs.pop("cls", None) request = build_list_connection_strings_request( ingestion_setting_name=ingestion_setting_name, @@ -483,9 +491,9 @@ async def list_connection_strings(self, ingestion_setting_name: str, **kwargs: A params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -502,4 +510,6 @@ async def list_connection_strings(self, ingestion_setting_name: str, **kwargs: A return deserialized - list_connection_strings.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings"} # type: ignore + list_connection_strings.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/models/__init__.py index 35a794f76866..439fe0cadcea 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/models/__init__.py @@ -15,7 +15,7 @@ from ._models_py3 import IngestionSettingToken from ._models_py3 import Resource from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/operations/__init__.py index af84327affac..e0aa0c4329cb 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/operations/__init__.py @@ -9,7 +9,7 @@ from ._ingestion_settings_operations import IngestionSettingsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/operations/_ingestion_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/operations/_ingestion_settings_operations.py index b59efd30e6fd..b6bf091766a1 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/operations/_ingestion_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/operations/_ingestion_settings_operations.py @@ -45,9 +45,9 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,9 +73,9 @@ def build_get_request(ingestion_setting_name: str, subscription_id: str, **kwarg _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +90,7 @@ def build_get_request(ingestion_setting_name: str, subscription_id: str, **kwarg "ingestionSettingName": _SERIALIZER.url("ingestion_setting_name", ingestion_setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -105,10 +105,10 @@ def build_create_request(ingestion_setting_name: str, subscription_id: str, **kw _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,7 +123,7 @@ def build_create_request(ingestion_setting_name: str, subscription_id: str, **kw "ingestionSettingName": _SERIALIZER.url("ingestion_setting_name", ingestion_setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -140,9 +140,9 @@ def build_delete_request(ingestion_setting_name: str, subscription_id: str, **kw _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -157,7 +157,7 @@ def build_delete_request(ingestion_setting_name: str, subscription_id: str, **kw "ingestionSettingName": _SERIALIZER.url("ingestion_setting_name", ingestion_setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -172,9 +172,9 @@ def build_list_tokens_request(ingestion_setting_name: str, subscription_id: str, _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -189,7 +189,7 @@ def build_list_tokens_request(ingestion_setting_name: str, subscription_id: str, "ingestionSettingName": _SERIALIZER.url("ingestion_setting_name", ingestion_setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -206,9 +206,9 @@ def build_list_connection_strings_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -223,7 +223,7 @@ def build_list_connection_strings_request( "ingestionSettingName": _SERIALIZER.url("ingestion_setting_name", ingestion_setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -267,10 +267,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.IngestionSetting"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IngestionSettingList] + ) + cls: ClsType[_models.IngestionSettingList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -291,7 +291,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -307,7 +307,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -315,13 +315,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("IngestionSettingList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -334,7 +334,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings"} @distributed_trace def get(self, ingestion_setting_name: str, **kwargs: Any) -> _models.IngestionSetting: @@ -359,10 +359,10 @@ def get(self, ingestion_setting_name: str, **kwargs: Any) -> _models.IngestionSe _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IngestionSetting] + ) + cls: ClsType[_models.IngestionSetting] = kwargs.pop("cls", None) request = build_get_request( ingestion_setting_name=ingestion_setting_name, @@ -373,9 +373,9 @@ def get(self, ingestion_setting_name: str, **kwargs: Any) -> _models.IngestionSe params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -392,7 +392,9 @@ def get(self, ingestion_setting_name: str, **kwargs: Any) -> _models.IngestionSe return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}" + } @overload def create( @@ -475,11 +477,11 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IngestionSetting] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IngestionSetting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -501,9 +503,9 @@ def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -520,7 +522,9 @@ def create( return deserialized - create.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}"} # type: ignore + create.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -546,10 +550,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( ingestion_setting_name=ingestion_setting_name, @@ -560,9 +564,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -575,7 +579,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}" + } @distributed_trace def list_tokens(self, ingestion_setting_name: str, **kwargs: Any) -> _models.IngestionSettingToken: @@ -600,10 +606,10 @@ def list_tokens(self, ingestion_setting_name: str, **kwargs: Any) -> _models.Ing _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.IngestionSettingToken] + ) + cls: ClsType[_models.IngestionSettingToken] = kwargs.pop("cls", None) request = build_list_tokens_request( ingestion_setting_name=ingestion_setting_name, @@ -614,9 +620,9 @@ def list_tokens(self, ingestion_setting_name: str, **kwargs: Any) -> _models.Ing params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -633,7 +639,9 @@ def list_tokens(self, ingestion_setting_name: str, **kwargs: Any) -> _models.Ing return deserialized - list_tokens.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens"} # type: ignore + list_tokens.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens" + } @distributed_trace def list_connection_strings(self, ingestion_setting_name: str, **kwargs: Any) -> _models.ConnectionStrings: @@ -657,10 +665,10 @@ def list_connection_strings(self, ingestion_setting_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-01-15-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-01-15-preview") - ) # type: Literal["2021-01-15-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectionStrings] + ) + cls: ClsType[_models.ConnectionStrings] = kwargs.pop("cls", None) request = build_list_connection_strings_request( ingestion_setting_name=ingestion_setting_name, @@ -671,9 +679,9 @@ def list_connection_strings(self, ingestion_setting_name: str, **kwargs: Any) -> params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -690,4 +698,6 @@ def list_connection_strings(self, ingestion_setting_name: str, **kwargs: Any) -> return deserialized - list_connection_strings.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings"} # type: ignore + list_connection_strings.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_configuration.py index 3614699fc08f..c99cb4ba72ed 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-05-01-preview") # type: Literal["2021-05-01-preview"] + api_version: Literal["2021-05-01-preview"] = kwargs.pop("api_version", "2021-05-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_metadata.json index 51725a878d15..dd9f113bb59e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_security_center.py index b8f322040926..427b471e349d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import SoftwareInventoriesOperations @@ -49,7 +49,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -79,15 +79,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/_configuration.py index 938dfefc1977..60efdbca3565 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-05-01-preview") # type: Literal["2021-05-01-preview"] + api_version: Literal["2021-05-01-preview"] = kwargs.pop("api_version", "2021-05-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/_security_center.py index 38a819cef40a..d5527f3a483e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import SoftwareInventoriesOperations @@ -49,7 +49,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/operations/__init__.py index e7e69c997540..7bacc485fce7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/operations/__init__.py @@ -9,7 +9,7 @@ from ._software_inventories_operations import SoftwareInventoriesOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/operations/_software_inventories_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/operations/_software_inventories_operations.py index efd086d3f9d3..d88d411affed 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/operations/_software_inventories_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/aio/operations/_software_inventories_operations.py @@ -86,10 +86,10 @@ def list_by_extended_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SoftwaresList] + ) + cls: ClsType[_models.SoftwaresList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -114,7 +114,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -130,7 +130,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -138,13 +138,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SoftwaresList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -157,7 +157,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_extended_resource.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories"} # type: ignore + list_by_extended_resource.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories" + } @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Software"]: @@ -172,10 +174,10 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Software _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SoftwaresList] + ) + cls: ClsType[_models.SoftwaresList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -196,7 +198,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -212,7 +214,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -220,13 +222,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SoftwaresList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -239,7 +241,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories" + } @distributed_trace_async async def get( @@ -280,10 +284,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Software] + ) + cls: ClsType[_models.Software] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -298,9 +302,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -317,4 +321,6 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/models/__init__.py index b98811f9a86c..75809ee4c6fa 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/models/__init__.py @@ -14,7 +14,7 @@ from ._security_center_enums import EndOfSupportStatus from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/operations/__init__.py index e7e69c997540..7bacc485fce7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/operations/__init__.py @@ -9,7 +9,7 @@ from ._software_inventories_operations import SoftwareInventoriesOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/operations/_software_inventories_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/operations/_software_inventories_operations.py index 1cb5f3c1fad4..aa3e9df00754 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/operations/_software_inventories_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/operations/_software_inventories_operations.py @@ -52,9 +52,9 @@ def build_list_by_extended_resource_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,7 @@ def build_list_by_extended_resource_request( "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -89,9 +89,9 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +104,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -127,9 +127,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +150,7 @@ def build_get_request( "softwareName": _SERIALIZER.url("software_name", software_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -203,10 +203,10 @@ def list_by_extended_resource( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SoftwaresList] + ) + cls: ClsType[_models.SoftwaresList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -231,7 +231,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -247,7 +247,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -255,13 +255,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SoftwaresList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -274,7 +274,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_extended_resource.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories"} # type: ignore + list_by_extended_resource.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories" + } @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Software"]: @@ -288,10 +290,10 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Software"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SoftwaresList] + ) + cls: ClsType[_models.SoftwaresList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -312,7 +314,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -328,7 +330,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -336,13 +338,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SoftwaresList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -355,7 +357,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories" + } @distributed_trace def get( @@ -396,10 +400,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-05-01-preview") - ) # type: Literal["2021-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Software] + ) + cls: ClsType[_models.Software] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -414,9 +418,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -433,4 +437,6 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_configuration.py index a751a5a17000..11f9ff4b52af 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-06-01") # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", "2021-06-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_metadata.json index 79bc9c66c629..233a48c471bd 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_security_center.py index f665df89b9c3..e939a0b85f29 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import AssessmentsMetadataOperations, AssessmentsOperations, SettingsOperations @@ -53,7 +53,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -85,15 +85,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/_configuration.py index dd03c6205884..b30183a57923 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-06-01") # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", "2021-06-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/_security_center.py index 436951dc7106..2be3e4bfdac1 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import AssessmentsMetadataOperations, AssessmentsOperations, SettingsOperations @@ -53,7 +53,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/operations/__init__.py index 560b419352e7..11c9d4115be9 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/operations/__init__.py @@ -11,7 +11,7 @@ from ._assessments_operations import AssessmentsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/operations/_assessments_metadata_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/operations/_assessments_metadata_operations.py index dcb5a52502f5..ae0eb23ef525 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/operations/_assessments_metadata_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/operations/_assessments_metadata_operations.py @@ -79,8 +79,8 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.SecurityAssessmentMetada _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadataResponseList] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[_models.SecurityAssessmentMetadataResponseList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -100,7 +100,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -116,7 +116,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -124,13 +124,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityAssessmentMetadataResponseList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -143,7 +143,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.Security/assessmentMetadata"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Security/assessmentMetadata"} @distributed_trace_async async def get(self, assessment_metadata_name: str, **kwargs: Any) -> _models.SecurityAssessmentMetadataResponse: @@ -168,8 +168,8 @@ async def get(self, assessment_metadata_name: str, **kwargs: Any) -> _models.Sec _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadataResponse] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[_models.SecurityAssessmentMetadataResponse] = kwargs.pop("cls", None) request = build_get_request( assessment_metadata_name=assessment_metadata_name, @@ -179,9 +179,9 @@ async def get(self, assessment_metadata_name: str, **kwargs: Any) -> _models.Sec params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -198,7 +198,7 @@ async def get(self, assessment_metadata_name: str, **kwargs: Any) -> _models.Sec return deserialized - get.metadata = {"url": "/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} # type: ignore + get.metadata = {"url": "/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SecurityAssessmentMetadataResponse"]: @@ -214,8 +214,8 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Security _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadataResponseList] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[_models.SecurityAssessmentMetadataResponseList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -236,7 +236,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -252,7 +252,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -260,13 +260,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityAssessmentMetadataResponseList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -279,7 +279,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata" + } @distributed_trace_async async def get_in_subscription( @@ -306,8 +308,8 @@ async def get_in_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadataResponse] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[_models.SecurityAssessmentMetadataResponse] = kwargs.pop("cls", None) request = build_get_in_subscription_request( assessment_metadata_name=assessment_metadata_name, @@ -318,9 +320,9 @@ async def get_in_subscription( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -337,7 +339,9 @@ async def get_in_subscription( return deserialized - get_in_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} # type: ignore + get_in_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}" + } @overload async def create_in_subscription( @@ -425,9 +429,9 @@ async def create_in_subscription( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadataResponse] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityAssessmentMetadataResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -449,9 +453,9 @@ async def create_in_subscription( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -468,7 +472,9 @@ async def create_in_subscription( return deserialized - create_in_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} # type: ignore + create_in_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}" + } @distributed_trace_async async def delete_in_subscription( # pylint: disable=inconsistent-return-statements @@ -496,8 +502,8 @@ async def delete_in_subscription( # pylint: disable=inconsistent-return-stateme _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_in_subscription_request( assessment_metadata_name=assessment_metadata_name, @@ -508,9 +514,9 @@ async def delete_in_subscription( # pylint: disable=inconsistent-return-stateme params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -523,4 +529,6 @@ async def delete_in_subscription( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - delete_in_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} # type: ignore + delete_in_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/operations/_assessments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/operations/_assessments_operations.py index c212a1adcd27..e2c8e527e2f3 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/operations/_assessments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/operations/_assessments_operations.py @@ -81,8 +81,8 @@ def list(self, scope: str, **kwargs: Any) -> AsyncIterable["_models.SecurityAsse _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentList] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[_models.SecurityAssessmentList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -103,7 +103,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -119,7 +119,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -127,13 +127,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityAssessmentList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -146,7 +146,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments"} @distributed_trace_async async def get( @@ -181,8 +181,8 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentResponse] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[_models.SecurityAssessmentResponse] = kwargs.pop("cls", None) request = build_get_request( resource_id=resource_id, @@ -194,9 +194,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -213,7 +213,7 @@ async def get( return deserialized - get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} # type: ignore + get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} @overload async def create_or_update( @@ -304,9 +304,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentResponse] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityAssessmentResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -328,9 +328,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -347,11 +347,11 @@ async def create_or_update( deserialized = self._deserialize("SecurityAssessmentResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} # type: ignore + create_or_update.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -380,8 +380,8 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_id=resource_id, @@ -392,9 +392,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -407,4 +407,4 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} # type: ignore + delete.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/operations/_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/operations/_settings_operations.py index a26ac7f2970e..b9ec501a18ce 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/operations/_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/aio/operations/_settings_operations.py @@ -71,8 +71,8 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Setting"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SettingsList] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[_models.SettingsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -93,7 +93,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -109,7 +109,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -117,13 +117,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SettingsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -136,7 +136,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings"} @distributed_trace_async async def get(self, setting_name: Union[str, _models.Enum1], **kwargs: Any) -> _models.Setting: @@ -161,8 +161,8 @@ async def get(self, setting_name: Union[str, _models.Enum1], **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Setting] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[_models.Setting] = kwargs.pop("cls", None) request = build_get_request( setting_name=setting_name, @@ -173,9 +173,9 @@ async def get(self, setting_name: Union[str, _models.Enum1], **kwargs: Any) -> _ params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -192,7 +192,7 @@ async def get(self, setting_name: Union[str, _models.Enum1], **kwargs: Any) -> _ return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} @overload async def update( @@ -274,9 +274,9 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Setting] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Setting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -298,9 +298,9 @@ async def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -317,4 +317,4 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} # type: ignore + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/models/__init__.py index cf002ba6c053..fed88292bc78 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/models/__init__.py @@ -49,7 +49,7 @@ from ._security_center_enums import Threats from ._security_center_enums import UserImpact from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/models/_models_py3.py index 9697815fecc0..aa6ff678716e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/models/_models_py3.py @@ -89,7 +89,7 @@ class Setting(Resource): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.kind = None # type: Optional[str] + self.kind: Optional[str] = None class AlertSyncSettings(Setting): @@ -133,7 +133,7 @@ def __init__(self, *, enabled: Optional[bool] = None, **kwargs): :paramtype enabled: bool """ super().__init__(**kwargs) - self.kind = "AlertSyncSettings" # type: str + self.kind: str = "AlertSyncSettings" self.enabled = enabled @@ -291,7 +291,7 @@ class ResourceDetails(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.source = None # type: Optional[str] + self.source: Optional[str] = None class AzureResourceDetails(ResourceDetails): @@ -321,7 +321,7 @@ class AzureResourceDetails(ResourceDetails): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.source = "Azure" # type: str + self.source: str = "Azure" self.id = None @@ -409,7 +409,7 @@ def __init__(self, *, enabled: Optional[bool] = None, **kwargs): :paramtype enabled: bool """ super().__init__(**kwargs) - self.kind = "DataExportSettings" # type: str + self.kind: str = "DataExportSettings" self.enabled = enabled @@ -492,7 +492,7 @@ def __init__(self, *, workspace_id: str, vmuuid: str, source_computer_id: str, m :paramtype machine_name: str """ super().__init__(**kwargs) - self.source = "OnPremise" # type: str + self.source: str = "OnPremise" self.workspace_id = workspace_id self.vmuuid = vmuuid self.source_computer_id = source_computer_id @@ -573,7 +573,7 @@ def __init__( machine_name=machine_name, **kwargs ) - self.source = "OnPremiseSql" # type: str + self.source: str = "OnPremiseSql" self.server_name = server_name self.database_name = database_name diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/operations/__init__.py index 560b419352e7..11c9d4115be9 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/operations/__init__.py @@ -11,7 +11,7 @@ from ._assessments_operations import AssessmentsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/operations/_assessments_metadata_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/operations/_assessments_metadata_operations.py index adb88f6af608..06cc3a617726 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/operations/_assessments_metadata_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/operations/_assessments_metadata_operations.py @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +64,7 @@ def build_get_request(assessment_metadata_name: str, **kwargs: Any) -> HttpReque _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_get_request(assessment_metadata_name: str, **kwargs: Any) -> HttpReque "assessmentMetadataName": _SERIALIZER.url("assessment_metadata_name", assessment_metadata_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -88,7 +88,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +99,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,7 +116,7 @@ def build_get_in_subscription_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +131,7 @@ def build_get_in_subscription_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -148,8 +148,8 @@ def build_create_in_subscription_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +164,7 @@ def build_create_in_subscription_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -183,7 +183,7 @@ def build_delete_in_subscription_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +198,7 @@ def build_delete_in_subscription_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -242,8 +242,8 @@ def list(self, **kwargs: Any) -> Iterable["_models.SecurityAssessmentMetadataRes _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadataResponseList] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[_models.SecurityAssessmentMetadataResponseList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -263,7 +263,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -279,7 +279,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -287,13 +287,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityAssessmentMetadataResponseList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -306,7 +306,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/providers/Microsoft.Security/assessmentMetadata"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Security/assessmentMetadata"} @distributed_trace def get(self, assessment_metadata_name: str, **kwargs: Any) -> _models.SecurityAssessmentMetadataResponse: @@ -331,8 +331,8 @@ def get(self, assessment_metadata_name: str, **kwargs: Any) -> _models.SecurityA _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadataResponse] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[_models.SecurityAssessmentMetadataResponse] = kwargs.pop("cls", None) request = build_get_request( assessment_metadata_name=assessment_metadata_name, @@ -342,9 +342,9 @@ def get(self, assessment_metadata_name: str, **kwargs: Any) -> _models.SecurityA params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -361,7 +361,7 @@ def get(self, assessment_metadata_name: str, **kwargs: Any) -> _models.SecurityA return deserialized - get.metadata = {"url": "/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} # type: ignore + get.metadata = {"url": "/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SecurityAssessmentMetadataResponse"]: @@ -377,8 +377,8 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SecurityAsses _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadataResponseList] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[_models.SecurityAssessmentMetadataResponseList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -399,7 +399,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -415,7 +415,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -423,13 +423,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityAssessmentMetadataResponseList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -442,7 +442,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata" + } @distributed_trace def get_in_subscription( @@ -469,8 +471,8 @@ def get_in_subscription( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadataResponse] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[_models.SecurityAssessmentMetadataResponse] = kwargs.pop("cls", None) request = build_get_in_subscription_request( assessment_metadata_name=assessment_metadata_name, @@ -481,9 +483,9 @@ def get_in_subscription( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -500,7 +502,9 @@ def get_in_subscription( return deserialized - get_in_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} # type: ignore + get_in_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}" + } @overload def create_in_subscription( @@ -588,9 +592,9 @@ def create_in_subscription( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentMetadataResponse] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityAssessmentMetadataResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -612,9 +616,9 @@ def create_in_subscription( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -631,7 +635,9 @@ def create_in_subscription( return deserialized - create_in_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} # type: ignore + create_in_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}" + } @distributed_trace def delete_in_subscription( # pylint: disable=inconsistent-return-statements @@ -659,8 +665,8 @@ def delete_in_subscription( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_in_subscription_request( assessment_metadata_name=assessment_metadata_name, @@ -671,9 +677,9 @@ def delete_in_subscription( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -686,4 +692,6 @@ def delete_in_subscription( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete_in_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"} # type: ignore + delete_in_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/operations/_assessments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/operations/_assessments_operations.py index 1c27f11a49ec..84dd114162e8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/operations/_assessments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/operations/_assessments_operations.py @@ -45,7 +45,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,7 +54,7 @@ def build_list_request(scope: str, **kwargs: Any) -> HttpRequest: "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -71,7 +71,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +81,7 @@ def build_get_request( "assessmentName": _SERIALIZER.url("assessment_name", assessment_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -98,8 +98,8 @@ def build_create_or_update_request(resource_id: str, assessment_name: str, **kwa _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +109,7 @@ def build_create_or_update_request(resource_id: str, assessment_name: str, **kwa "assessmentName": _SERIALIZER.url("assessment_name", assessment_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -126,7 +126,7 @@ def build_delete_request(resource_id: str, assessment_name: str, **kwargs: Any) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -136,7 +136,7 @@ def build_delete_request(resource_id: str, assessment_name: str, **kwargs: Any) "assessmentName": _SERIALIZER.url("assessment_name", assessment_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -184,8 +184,8 @@ def list(self, scope: str, **kwargs: Any) -> Iterable["_models.SecurityAssessmen _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentList] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[_models.SecurityAssessmentList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -206,7 +206,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -222,7 +222,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -230,13 +230,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityAssessmentList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -249,7 +249,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments"} @distributed_trace def get( @@ -284,8 +284,8 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentResponse] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[_models.SecurityAssessmentResponse] = kwargs.pop("cls", None) request = build_get_request( resource_id=resource_id, @@ -297,9 +297,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -316,7 +316,7 @@ def get( return deserialized - get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} # type: ignore + get.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} @overload def create_or_update( @@ -407,9 +407,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityAssessmentResponse] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityAssessmentResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -431,9 +431,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -450,11 +450,11 @@ def create_or_update( deserialized = self._deserialize("SecurityAssessmentResponse", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} # type: ignore + create_or_update.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -483,8 +483,8 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_id=resource_id, @@ -495,9 +495,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -510,4 +510,4 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} # type: ignore + delete.metadata = {"url": "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/operations/_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/operations/_settings_operations.py index bb9185702e90..9ed3517ca953 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/operations/_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/operations/_settings_operations.py @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -71,7 +71,7 @@ def build_get_request(setting_name: Union[str, _models.Enum1], subscription_id: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_get_request(setting_name: Union[str, _models.Enum1], subscription_id: "settingName": _SERIALIZER.url("setting_name", setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -100,8 +100,8 @@ def build_update_request(setting_name: Union[str, _models.Enum1], subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,7 +115,7 @@ def build_update_request(setting_name: Union[str, _models.Enum1], subscription_i "settingName": _SERIALIZER.url("setting_name", setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -159,8 +159,8 @@ def list(self, **kwargs: Any) -> Iterable["_models.Setting"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SettingsList] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[_models.SettingsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -181,7 +181,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -197,7 +197,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -205,13 +205,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SettingsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -224,7 +224,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings"} @distributed_trace def get(self, setting_name: Union[str, _models.Enum1], **kwargs: Any) -> _models.Setting: @@ -249,8 +249,8 @@ def get(self, setting_name: Union[str, _models.Enum1], **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Setting] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + cls: ClsType[_models.Setting] = kwargs.pop("cls", None) request = build_get_request( setting_name=setting_name, @@ -261,9 +261,9 @@ def get(self, setting_name: Union[str, _models.Enum1], **kwargs: Any) -> _models params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -280,7 +280,7 @@ def get(self, setting_name: Union[str, _models.Enum1], **kwargs: Any) -> _models return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} @overload def update( @@ -362,9 +362,9 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) # type: Literal["2021-06-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Setting] + api_version: Literal["2021-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-06-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Setting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -386,9 +386,9 @@ def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -405,4 +405,4 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} # type: ignore + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_configuration.py index 9194a3328c1b..54f911a1dc08 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-07-01") # type: Literal["2021-07-01"] + api_version: Literal["2021-07-01"] = kwargs.pop("api_version", "2021-07-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_metadata.json index efc901abd95d..d8e3bbee5c6a 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_security_center.py index 3dc330c4f3f9..adb2e5071775 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import SettingsOperations @@ -48,7 +48,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -76,15 +76,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/_configuration.py index f3efe1774dd1..9275091da426 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-07-01") # type: Literal["2021-07-01"] + api_version: Literal["2021-07-01"] = kwargs.pop("api_version", "2021-07-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/_security_center.py index de5852103e68..16fa3a8eb747 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import SettingsOperations @@ -48,7 +48,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/operations/__init__.py index 0b0925b026d7..1046445c98b6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/operations/__init__.py @@ -9,7 +9,7 @@ from ._settings_operations import SettingsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/operations/_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/operations/_settings_operations.py index fa070305ec9f..a06e991ae2b4 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/operations/_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/aio/operations/_settings_operations.py @@ -71,8 +71,8 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Setting"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SettingsList] + api_version: Literal["2021-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + cls: ClsType[_models.SettingsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -93,7 +93,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -109,7 +109,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -117,13 +117,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SettingsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -136,7 +136,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings"} @distributed_trace_async async def get(self, setting_name: Union[str, _models.SettingName], **kwargs: Any) -> _models.Setting: @@ -161,8 +161,8 @@ async def get(self, setting_name: Union[str, _models.SettingName], **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Setting] + api_version: Literal["2021-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + cls: ClsType[_models.Setting] = kwargs.pop("cls", None) request = build_get_request( setting_name=setting_name, @@ -173,9 +173,9 @@ async def get(self, setting_name: Union[str, _models.SettingName], **kwargs: Any params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -192,7 +192,7 @@ async def get(self, setting_name: Union[str, _models.SettingName], **kwargs: Any return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} @overload async def update( @@ -274,9 +274,9 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Setting] + api_version: Literal["2021-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Setting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -298,9 +298,9 @@ async def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -317,4 +317,4 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} # type: ignore + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/models/__init__.py index 63e5f8c91733..ce862c57b5f2 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/models/__init__.py @@ -17,7 +17,7 @@ from ._security_center_enums import SettingKind from ._security_center_enums import SettingName from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/models/_models_py3.py index 614e2db39baa..73e80249ec4c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/models/_models_py3.py @@ -85,7 +85,7 @@ class Setting(Resource): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.kind = None # type: Optional[str] + self.kind: Optional[str] = None class AlertSyncSettings(Setting): @@ -129,7 +129,7 @@ def __init__(self, *, enabled: Optional[bool] = None, **kwargs): :paramtype enabled: bool """ super().__init__(**kwargs) - self.kind = "AlertSyncSettings" # type: str + self.kind: str = "AlertSyncSettings" self.enabled = enabled @@ -217,7 +217,7 @@ def __init__(self, *, enabled: Optional[bool] = None, **kwargs): :paramtype enabled: bool """ super().__init__(**kwargs) - self.kind = "DataExportSettings" # type: str + self.kind: str = "DataExportSettings" self.enabled = enabled diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/operations/__init__.py index 0b0925b026d7..1046445c98b6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/operations/__init__.py @@ -9,7 +9,7 @@ from ._settings_operations import SettingsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/operations/_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/operations/_settings_operations.py index e5e076466b76..c082dfd923f2 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/operations/_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/operations/_settings_operations.py @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] + api_version: Literal["2021-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,7 +73,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] + api_version: Literal["2021-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +87,7 @@ def build_get_request( "settingName": _SERIALIZER.url("setting_name", setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -104,8 +104,8 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2021-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -119,7 +119,7 @@ def build_update_request( "settingName": _SERIALIZER.url("setting_name", setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,8 +163,8 @@ def list(self, **kwargs: Any) -> Iterable["_models.Setting"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SettingsList] + api_version: Literal["2021-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + cls: ClsType[_models.SettingsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -185,7 +185,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -201,7 +201,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -209,13 +209,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SettingsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -228,7 +228,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings"} @distributed_trace def get(self, setting_name: Union[str, _models.SettingName], **kwargs: Any) -> _models.Setting: @@ -253,8 +253,8 @@ def get(self, setting_name: Union[str, _models.SettingName], **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Setting] + api_version: Literal["2021-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + cls: ClsType[_models.Setting] = kwargs.pop("cls", None) request = build_get_request( setting_name=setting_name, @@ -265,9 +265,9 @@ def get(self, setting_name: Union[str, _models.SettingName], **kwargs: Any) -> _ params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -284,7 +284,7 @@ def get(self, setting_name: Union[str, _models.SettingName], **kwargs: Any) -> _ return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} @overload def update( @@ -366,9 +366,9 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: Literal["2021-07-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Setting] + api_version: Literal["2021-07-01"] = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Setting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -390,9 +390,9 @@ def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -409,4 +409,4 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} # type: ignore + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_configuration.py index ff11a8f61b7d..5e3789643869 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-07-01-preview") # type: Literal["2021-07-01-preview"] + api_version: Literal["2021-07-01-preview"] = kwargs.pop("api_version", "2021-07-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_metadata.json index 374729f3205b..76f67b66ecb8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_security_center.py index 3cd90ad4ba88..ce74378c220f 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ( @@ -59,7 +59,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -95,15 +95,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/_configuration.py index 5e96849ba4bc..e13c808ad346 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-07-01-preview") # type: Literal["2021-07-01-preview"] + api_version: Literal["2021-07-01-preview"] = kwargs.pop("api_version", "2021-07-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/_security_center.py index 3ae750e64250..cd85b88cf12b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ( @@ -59,7 +59,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/operations/__init__.py index f8be4db79c2f..395581c73e89 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/operations/__init__.py @@ -11,7 +11,7 @@ from ._security_connectors_operations import SecurityConnectorsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/operations/_custom_assessment_automations_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/operations/_custom_assessment_automations_operations.py index 1a0c4fffaf31..c117bc9495ae 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/operations/_custom_assessment_automations_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/operations/_custom_assessment_automations_operations.py @@ -94,10 +94,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomAssessmentAutomation] + ) + cls: ClsType[_models.CustomAssessmentAutomation] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -109,9 +109,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -128,7 +128,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}" + } @overload async def create( @@ -234,11 +236,11 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomAssessmentAutomation] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomAssessmentAutomation] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -261,9 +263,9 @@ async def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -280,11 +282,13 @@ async def create( deserialized = self._deserialize("CustomAssessmentAutomation", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}"} # type: ignore + create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -315,10 +319,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -330,9 +334,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -345,7 +349,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}" + } @distributed_trace def list_by_resource_group( @@ -368,10 +374,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomAssessmentAutomationsListResult] + ) + cls: ClsType[_models.CustomAssessmentAutomationsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -393,7 +399,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -409,7 +415,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -417,13 +423,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("CustomAssessmentAutomationsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -436,7 +442,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations" + } @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.CustomAssessmentAutomation"]: @@ -454,10 +462,10 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.CustomAs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomAssessmentAutomationsListResult] + ) + cls: ClsType[_models.CustomAssessmentAutomationsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -478,7 +486,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -494,7 +502,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -502,13 +510,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("CustomAssessmentAutomationsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -521,4 +529,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/customAssessmentAutomations"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/customAssessmentAutomations" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/operations/_custom_entity_store_assignments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/operations/_custom_entity_store_assignments_operations.py index 389ec974975e..14f1be47b9b7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/operations/_custom_entity_store_assignments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/operations/_custom_entity_store_assignments_operations.py @@ -95,10 +95,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomEntityStoreAssignment] + ) + cls: ClsType[_models.CustomEntityStoreAssignment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -110,9 +110,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -129,7 +129,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}" + } @overload async def create( @@ -237,11 +239,11 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomEntityStoreAssignment] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomEntityStoreAssignment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -266,9 +268,9 @@ async def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -285,11 +287,13 @@ async def create( deserialized = self._deserialize("CustomEntityStoreAssignment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}"} # type: ignore + create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -321,10 +325,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -336,9 +340,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -351,7 +355,9 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}" + } @distributed_trace def list_by_resource_group( @@ -374,10 +380,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomEntityStoreAssignmentsListResult] + ) + cls: ClsType[_models.CustomEntityStoreAssignmentsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -399,7 +405,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -415,7 +421,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -423,13 +429,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("CustomEntityStoreAssignmentsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -442,7 +448,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments" + } @distributed_trace def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.CustomEntityStoreAssignment"]: @@ -460,10 +468,10 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.CustomEn _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomEntityStoreAssignmentsListResult] + ) + cls: ClsType[_models.CustomEntityStoreAssignmentsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -484,7 +492,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -500,7 +508,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -508,13 +516,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("CustomEntityStoreAssignmentsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -527,4 +535,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/customEntityStoreAssignments"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/customEntityStoreAssignments" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/operations/_security_connectors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/operations/_security_connectors_operations.py index cbdaa5a77d2b..7eb1c1c00bd2 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/operations/_security_connectors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/aio/operations/_security_connectors_operations.py @@ -79,10 +79,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.SecurityConnector"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnectorsList] + ) + cls: ClsType[_models.SecurityConnectorsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -103,7 +103,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -119,7 +119,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -127,13 +127,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityConnectorsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -146,7 +146,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors"} @distributed_trace def list_by_resource_group( @@ -167,10 +167,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnectorsList] + ) + cls: ClsType[_models.SecurityConnectorsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -192,7 +192,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -208,7 +208,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -216,13 +216,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityConnectorsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -235,7 +235,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors" + } @distributed_trace_async async def get( @@ -264,10 +266,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -279,9 +281,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -298,7 +300,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @overload async def create_or_update( @@ -397,11 +401,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -424,9 +428,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -443,11 +447,13 @@ async def create_or_update( deserialized = self._deserialize("SecurityConnector", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @overload async def update( @@ -543,11 +549,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -570,9 +576,9 @@ async def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -589,7 +595,9 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -618,10 +626,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -633,9 +641,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -648,4 +656,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/models/__init__.py index 6aa5de755b0b..4e9aeed6ee6e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/models/__init__.py @@ -46,7 +46,7 @@ from ._security_center_enums import SeverityEnum from ._security_center_enums import SupportedCloudEnum from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/models/_models_py3.py index 4f32f10cb1e8..b0d20c0d2c85 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/models/_models_py3.py @@ -122,7 +122,7 @@ class CloudOffering(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.offering_type = None # type: Optional[str] + self.offering_type: Optional[str] = None self.description = None @@ -170,7 +170,7 @@ def __init__( ~azure.mgmt.security.v2021_07_01_preview.models.CspmMonitorAwsOfferingNativeCloudConnection """ super().__init__(**kwargs) - self.offering_type = "CspmMonitorAws" # type: str + self.offering_type: str = "CspmMonitorAws" self.native_cloud_connection = native_cloud_connection @@ -630,7 +630,7 @@ def __init__( ~azure.mgmt.security.v2021_07_01_preview.models.DefenderForContainersAwsOfferingKinesisToS3 """ super().__init__(**kwargs) - self.offering_type = "DefenderForContainersAws" # type: str + self.offering_type: str = "DefenderForContainersAws" self.kubernetes_service = kubernetes_service self.kubernetes_scuba_reader = kubernetes_scuba_reader self.cloud_watch_to_kinesis = cloud_watch_to_kinesis @@ -772,7 +772,7 @@ def __init__( ~azure.mgmt.security.v2021_07_01_preview.models.DefenderForServersAwsOfferingArcAutoProvisioning """ super().__init__(**kwargs) - self.offering_type = "DefenderForServersAws" # type: str + self.offering_type: str = "DefenderForServersAws" self.defender_for_servers = defender_for_servers self.arc_auto_provisioning = arc_auto_provisioning @@ -971,7 +971,7 @@ def __init__( ~azure.mgmt.security.v2021_07_01_preview.models.InformationProtectionAwsOfferingInformationProtection """ super().__init__(**kwargs) - self.offering_type = "InformationProtectionAws" # type: str + self.offering_type: str = "InformationProtectionAws" self.information_protection = information_protection diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/operations/__init__.py index f8be4db79c2f..395581c73e89 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/operations/__init__.py @@ -11,7 +11,7 @@ from ._security_connectors_operations import SecurityConnectorsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/operations/_custom_assessment_automations_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/operations/_custom_assessment_automations_operations.py index 69b42c942dcd..8932ee8d1189 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/operations/_custom_assessment_automations_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/operations/_custom_assessment_automations_operations.py @@ -47,9 +47,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,10 +86,10 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +109,7 @@ def build_create_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -128,9 +128,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +150,7 @@ def build_delete_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -165,9 +165,9 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,7 +184,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -199,9 +199,9 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +214,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -274,10 +274,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomAssessmentAutomation] + ) + cls: ClsType[_models.CustomAssessmentAutomation] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -289,9 +289,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -308,7 +308,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}" + } @overload def create( @@ -414,11 +416,11 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomAssessmentAutomation] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomAssessmentAutomation] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -441,9 +443,9 @@ def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -460,11 +462,13 @@ def create( deserialized = self._deserialize("CustomAssessmentAutomation", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}"} # type: ignore + create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -495,10 +499,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -510,9 +514,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -525,7 +529,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}" + } @distributed_trace def list_by_resource_group( @@ -548,10 +554,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomAssessmentAutomationsListResult] + ) + cls: ClsType[_models.CustomAssessmentAutomationsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -573,7 +579,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -589,7 +595,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -597,13 +603,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("CustomAssessmentAutomationsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -616,7 +622,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations" + } @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.CustomAssessmentAutomation"]: @@ -634,10 +642,10 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.CustomAssessm _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomAssessmentAutomationsListResult] + ) + cls: ClsType[_models.CustomAssessmentAutomationsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -658,7 +666,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -674,7 +682,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -682,13 +690,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("CustomAssessmentAutomationsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -701,4 +709,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/customAssessmentAutomations"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/customAssessmentAutomations" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/operations/_custom_entity_store_assignments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/operations/_custom_entity_store_assignments_operations.py index e1ec5f2bdfaf..d79a05d1304a 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/operations/_custom_entity_store_assignments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/operations/_custom_entity_store_assignments_operations.py @@ -47,9 +47,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_get_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,10 +86,10 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +109,7 @@ def build_create_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -128,9 +128,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +150,7 @@ def build_delete_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -165,9 +165,9 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,7 +184,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -199,9 +199,9 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +214,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -275,10 +275,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomEntityStoreAssignment] + ) + cls: ClsType[_models.CustomEntityStoreAssignment] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -290,9 +290,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -309,7 +309,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}" + } @overload def create( @@ -417,11 +419,11 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomEntityStoreAssignment] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CustomEntityStoreAssignment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -446,9 +448,9 @@ def create( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -465,11 +467,13 @@ def create( deserialized = self._deserialize("CustomEntityStoreAssignment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}"} # type: ignore + create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -501,10 +505,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -516,9 +520,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -531,7 +535,9 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}" + } @distributed_trace def list_by_resource_group( @@ -554,10 +560,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomEntityStoreAssignmentsListResult] + ) + cls: ClsType[_models.CustomEntityStoreAssignmentsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -579,7 +585,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -595,7 +601,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -603,13 +609,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("CustomEntityStoreAssignmentsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -622,7 +628,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments" + } @distributed_trace def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.CustomEntityStoreAssignment"]: @@ -640,10 +648,10 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.CustomEntityS _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomEntityStoreAssignmentsListResult] + ) + cls: ClsType[_models.CustomEntityStoreAssignmentsListResult] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -664,7 +672,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -680,7 +688,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -688,13 +696,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("CustomEntityStoreAssignmentsListResult", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -707,4 +715,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/customEntityStoreAssignments"} # type: ignore + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/customEntityStoreAssignments" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/operations/_security_connectors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/operations/_security_connectors_operations.py index ad867e4287d4..11ba72e8c088 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/operations/_security_connectors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/operations/_security_connectors_operations.py @@ -45,9 +45,9 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,9 +73,9 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -109,9 +109,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -129,7 +129,7 @@ def build_get_request( "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,10 +146,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -167,7 +167,7 @@ def build_create_or_update_request( "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -186,10 +186,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +207,7 @@ def build_update_request( "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -226,9 +226,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -246,7 +246,7 @@ def build_delete_request( "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -290,10 +290,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.SecurityConnector"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnectorsList] + ) + cls: ClsType[_models.SecurityConnectorsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -314,7 +314,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -330,7 +330,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -338,13 +338,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityConnectorsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -357,7 +357,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors"} @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.SecurityConnector"]: @@ -376,10 +376,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnectorsList] + ) + cls: ClsType[_models.SecurityConnectorsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -401,7 +401,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -417,7 +417,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -425,13 +425,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityConnectorsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -444,7 +444,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors" + } @distributed_trace def get(self, resource_group_name: str, security_connector_name: str, **kwargs: Any) -> _models.SecurityConnector: @@ -471,10 +473,10 @@ def get(self, resource_group_name: str, security_connector_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -486,9 +488,9 @@ def get(self, resource_group_name: str, security_connector_name: str, **kwargs: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -505,7 +507,9 @@ def get(self, resource_group_name: str, security_connector_name: str, **kwargs: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @overload def create_or_update( @@ -604,11 +608,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -631,9 +635,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -650,11 +654,13 @@ def create_or_update( deserialized = self._deserialize("SecurityConnector", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @overload def update( @@ -750,11 +756,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -777,9 +783,9 @@ def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -796,7 +802,9 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -825,10 +833,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-07-01-preview") - ) # type: Literal["2021-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -840,9 +848,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -855,4 +863,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_configuration.py index 9c10b6b87859..543fbef3c8f7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-10-01-preview") # type: Literal["2021-10-01-preview"] + api_version: Literal["2021-10-01-preview"] = kwargs.pop("api_version", "2021-10-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_metadata.json index 99191c265762..e9b94523edef 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_security_center.py index fd10b637870a..e289961108de 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import MdeOnboardingsOperations @@ -49,7 +49,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -77,15 +77,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/_configuration.py index bf874fb09566..50bafc8fc86f 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2021-10-01-preview") # type: Literal["2021-10-01-preview"] + api_version: Literal["2021-10-01-preview"] = kwargs.pop("api_version", "2021-10-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/_security_center.py index 7d42b3093fde..4e49f4f2382c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import MdeOnboardingsOperations @@ -49,7 +49,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/operations/__init__.py index 1c4389328fa3..cf82df5f135a 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/operations/__init__.py @@ -9,7 +9,7 @@ from ._mde_onboardings_operations import MdeOnboardingsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/operations/_mde_onboardings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/operations/_mde_onboardings_operations.py index 5ade8af29984..aaf59e91077d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/operations/_mde_onboardings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/aio/operations/_mde_onboardings_operations.py @@ -75,10 +75,10 @@ async def list(self, **kwargs: Any) -> _models.MdeOnboardingDataList: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-10-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-10-01-preview") - ) # type: Literal["2021-10-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MdeOnboardingDataList] + ) + cls: ClsType[_models.MdeOnboardingDataList] = kwargs.pop("cls", None) request = build_list_request( subscription_id=self._config.subscription_id, @@ -88,9 +88,9 @@ async def list(self, **kwargs: Any) -> _models.MdeOnboardingDataList: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -107,7 +107,7 @@ async def list(self, **kwargs: Any) -> _models.MdeOnboardingDataList: return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings"} @distributed_trace_async async def get(self, **kwargs: Any) -> _models.MdeOnboardingData: @@ -129,10 +129,10 @@ async def get(self, **kwargs: Any) -> _models.MdeOnboardingData: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-10-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-10-01-preview") - ) # type: Literal["2021-10-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MdeOnboardingData] + ) + cls: ClsType[_models.MdeOnboardingData] = kwargs.pop("cls", None) request = build_get_request( subscription_id=self._config.subscription_id, @@ -142,9 +142,9 @@ async def get(self, **kwargs: Any) -> _models.MdeOnboardingData: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -161,4 +161,4 @@ async def get(self, **kwargs: Any) -> _models.MdeOnboardingData: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings/default"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings/default"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/models/__init__.py index b94357acce61..cb8c7cea8637 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/models/__init__.py @@ -12,7 +12,7 @@ from ._models_py3 import MdeOnboardingDataList from ._models_py3 import Resource from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/operations/__init__.py index 1c4389328fa3..cf82df5f135a 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/operations/__init__.py @@ -9,7 +9,7 @@ from ._mde_onboardings_operations import MdeOnboardingsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/operations/_mde_onboardings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/operations/_mde_onboardings_operations.py index 537642b6028f..089a030d543e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/operations/_mde_onboardings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/operations/_mde_onboardings_operations.py @@ -43,9 +43,9 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-10-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-10-01-preview") - ) # type: Literal["2021-10-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -71,9 +71,9 @@ def build_get_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-10-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-10-01-preview") - ) # type: Literal["2021-10-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,7 +86,7 @@ def build_get_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -136,10 +136,10 @@ def list(self, **kwargs: Any) -> _models.MdeOnboardingDataList: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-10-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-10-01-preview") - ) # type: Literal["2021-10-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MdeOnboardingDataList] + ) + cls: ClsType[_models.MdeOnboardingDataList] = kwargs.pop("cls", None) request = build_list_request( subscription_id=self._config.subscription_id, @@ -149,9 +149,9 @@ def list(self, **kwargs: Any) -> _models.MdeOnboardingDataList: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -168,7 +168,7 @@ def list(self, **kwargs: Any) -> _models.MdeOnboardingDataList: return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings"} @distributed_trace def get(self, **kwargs: Any) -> _models.MdeOnboardingData: @@ -190,10 +190,10 @@ def get(self, **kwargs: Any) -> _models.MdeOnboardingData: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2021-10-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2021-10-01-preview") - ) # type: Literal["2021-10-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.MdeOnboardingData] + ) + cls: ClsType[_models.MdeOnboardingData] = kwargs.pop("cls", None) request = build_get_request( subscription_id=self._config.subscription_id, @@ -203,9 +203,9 @@ def get(self, **kwargs: Any) -> _models.MdeOnboardingData: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -222,4 +222,4 @@ def get(self, **kwargs: Any) -> _models.MdeOnboardingData: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings/default"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings/default"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_configuration.py index f82e49827e0f..2584275a45a7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-01-01") # type: Literal["2022-01-01"] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", "2022-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_metadata.json index d019af3e33e5..b72b0c672adc 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_security_center.py index 7715a7f00326..8dc38cabba2f 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import AlertsOperations @@ -50,7 +50,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -78,15 +78,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/_configuration.py index 2959d8611ba3..32a9bf18a2df 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-01-01") # type: Literal["2022-01-01"] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", "2022-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/_security_center.py index d10128e19d60..b84b6cadf269 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import AlertsOperations @@ -50,7 +50,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/operations/__init__.py index 522898d37fc6..b3a334939bbd 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/operations/__init__.py @@ -9,7 +9,7 @@ from ._alerts_operations import AlertsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/operations/_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/operations/_alerts_operations.py index 5322d47bdfc7..9e25c75e93da 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/operations/_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/operations/_alerts_operations.py @@ -88,8 +88,8 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Alert"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertList] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -110,7 +110,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -126,7 +126,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -134,13 +134,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -153,7 +153,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts"} @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Alert"]: @@ -170,8 +170,8 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertList] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -193,7 +193,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -209,7 +209,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -217,13 +217,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -236,7 +236,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts" + } @distributed_trace def list_subscription_level_by_region(self, asc_location: str, **kwargs: Any) -> AsyncIterable["_models.Alert"]: @@ -254,8 +256,8 @@ def list_subscription_level_by_region(self, asc_location: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertList] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -277,7 +279,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -293,7 +295,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -301,13 +303,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -320,7 +322,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_subscription_level_by_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts"} # type: ignore + list_subscription_level_by_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts" + } @distributed_trace def list_resource_group_level_by_region( @@ -343,8 +347,8 @@ def list_resource_group_level_by_region( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertList] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -367,7 +371,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -383,7 +387,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -391,13 +395,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("AlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -410,7 +414,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_resource_group_level_by_region.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts"} # type: ignore + list_resource_group_level_by_region.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts" + } @distributed_trace_async async def get_subscription_level(self, asc_location: str, alert_name: str, **kwargs: Any) -> _models.Alert: @@ -437,8 +443,8 @@ async def get_subscription_level(self, asc_location: str, alert_name: str, **kwa _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Alert] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[_models.Alert] = kwargs.pop("cls", None) request = build_get_subscription_level_request( asc_location=asc_location, @@ -450,9 +456,9 @@ async def get_subscription_level(self, asc_location: str, alert_name: str, **kwa params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -469,7 +475,9 @@ async def get_subscription_level(self, asc_location: str, alert_name: str, **kwa return deserialized - get_subscription_level.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}"} # type: ignore + get_subscription_level.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}" + } @distributed_trace_async async def get_resource_group_level( @@ -501,8 +509,8 @@ async def get_resource_group_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Alert] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[_models.Alert] = kwargs.pop("cls", None) request = build_get_resource_group_level_request( resource_group_name=resource_group_name, @@ -515,9 +523,9 @@ async def get_resource_group_level( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -534,7 +542,9 @@ async def get_resource_group_level( return deserialized - get_resource_group_level.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}"} # type: ignore + get_resource_group_level.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}" + } @distributed_trace_async async def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements @@ -563,8 +573,8 @@ async def update_subscription_level_state_to_dismiss( # pylint: disable=inconsi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_subscription_level_state_to_dismiss_request( asc_location=asc_location, @@ -576,9 +586,9 @@ async def update_subscription_level_state_to_dismiss( # pylint: disable=inconsi params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -591,7 +601,9 @@ async def update_subscription_level_state_to_dismiss( # pylint: disable=inconsi if cls: return cls(pipeline_response, None, {}) - update_subscription_level_state_to_dismiss.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss"} # type: ignore + update_subscription_level_state_to_dismiss.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss" + } @distributed_trace_async async def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent-return-statements @@ -620,8 +632,8 @@ async def update_subscription_level_state_to_resolve( # pylint: disable=inconsi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_subscription_level_state_to_resolve_request( asc_location=asc_location, @@ -633,9 +645,9 @@ async def update_subscription_level_state_to_resolve( # pylint: disable=inconsi params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -648,7 +660,9 @@ async def update_subscription_level_state_to_resolve( # pylint: disable=inconsi if cls: return cls(pipeline_response, None, {}) - update_subscription_level_state_to_resolve.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve"} # type: ignore + update_subscription_level_state_to_resolve.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve" + } @distributed_trace_async async def update_subscription_level_state_to_activate( # pylint: disable=inconsistent-return-statements @@ -677,8 +691,8 @@ async def update_subscription_level_state_to_activate( # pylint: disable=incons _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_subscription_level_state_to_activate_request( asc_location=asc_location, @@ -690,9 +704,9 @@ async def update_subscription_level_state_to_activate( # pylint: disable=incons params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -705,7 +719,9 @@ async def update_subscription_level_state_to_activate( # pylint: disable=incons if cls: return cls(pipeline_response, None, {}) - update_subscription_level_state_to_activate.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate"} # type: ignore + update_subscription_level_state_to_activate.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate" + } @distributed_trace_async async def update_subscription_level_state_to_in_progress( # pylint: disable=inconsistent-return-statements @@ -734,8 +750,8 @@ async def update_subscription_level_state_to_in_progress( # pylint: disable=inc _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_subscription_level_state_to_in_progress_request( asc_location=asc_location, @@ -747,9 +763,9 @@ async def update_subscription_level_state_to_in_progress( # pylint: disable=inc params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -762,7 +778,9 @@ async def update_subscription_level_state_to_in_progress( # pylint: disable=inc if cls: return cls(pipeline_response, None, {}) - update_subscription_level_state_to_in_progress.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress"} # type: ignore + update_subscription_level_state_to_in_progress.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress" + } @distributed_trace_async async def update_resource_group_level_state_to_resolve( # pylint: disable=inconsistent-return-statements @@ -794,8 +812,8 @@ async def update_resource_group_level_state_to_resolve( # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_resource_group_level_state_to_resolve_request( resource_group_name=resource_group_name, @@ -808,9 +826,9 @@ async def update_resource_group_level_state_to_resolve( # pylint: disable=incon params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -823,7 +841,9 @@ async def update_resource_group_level_state_to_resolve( # pylint: disable=incon if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_state_to_resolve.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve"} # type: ignore + update_resource_group_level_state_to_resolve.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve" + } @distributed_trace_async async def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements @@ -855,8 +875,8 @@ async def update_resource_group_level_state_to_dismiss( # pylint: disable=incon _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_resource_group_level_state_to_dismiss_request( resource_group_name=resource_group_name, @@ -869,9 +889,9 @@ async def update_resource_group_level_state_to_dismiss( # pylint: disable=incon params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -884,7 +904,9 @@ async def update_resource_group_level_state_to_dismiss( # pylint: disable=incon if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_state_to_dismiss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss"} # type: ignore + update_resource_group_level_state_to_dismiss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss" + } @distributed_trace_async async def update_resource_group_level_state_to_activate( # pylint: disable=inconsistent-return-statements @@ -916,8 +938,8 @@ async def update_resource_group_level_state_to_activate( # pylint: disable=inco _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_resource_group_level_state_to_activate_request( resource_group_name=resource_group_name, @@ -930,9 +952,9 @@ async def update_resource_group_level_state_to_activate( # pylint: disable=inco params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -945,7 +967,9 @@ async def update_resource_group_level_state_to_activate( # pylint: disable=inco if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_state_to_activate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate"} # type: ignore + update_resource_group_level_state_to_activate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate" + } @distributed_trace_async async def update_resource_group_level_state_to_in_progress( # pylint: disable=inconsistent-return-statements @@ -977,8 +1001,8 @@ async def update_resource_group_level_state_to_in_progress( # pylint: disable=i _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_resource_group_level_state_to_in_progress_request( resource_group_name=resource_group_name, @@ -991,9 +1015,9 @@ async def update_resource_group_level_state_to_in_progress( # pylint: disable=i params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1006,7 +1030,9 @@ async def update_resource_group_level_state_to_in_progress( # pylint: disable=i if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_state_to_in_progress.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress"} # type: ignore + update_resource_group_level_state_to_in_progress.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress" + } async def _simulate_initial( # pylint: disable=inconsistent-return-statements self, @@ -1025,9 +1051,9 @@ async def _simulate_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + 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 @@ -1049,9 +1075,9 @@ async def _simulate_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1064,7 +1090,9 @@ async def _simulate_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _simulate_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate"} # type: ignore + _simulate_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate" + } @overload async def begin_simulate( @@ -1165,12 +1193,12 @@ async def begin_simulate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._simulate_initial( # type: ignore asc_location=asc_location, @@ -1189,10 +1217,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: AsyncPollingMethod = cast( AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs), - ) # type: AsyncPollingMethod + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -1204,6 +1232,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_simulate.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate"} # type: ignore + begin_simulate.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/models/__init__.py index 5ecc2f93a8b7..21ba3cd6f9a7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/models/__init__.py @@ -27,7 +27,7 @@ from ._security_center_enums import KindEnum from ._security_center_enums import ResourceIdentifierType from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/models/_models_py3.py index d06450ef6ea1..08854db513af 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/models/_models_py3.py @@ -378,7 +378,7 @@ def __init__(self, *, additional_properties: Optional[Dict[str, Any]] = None, ** """ super().__init__(**kwargs) self.additional_properties = additional_properties - self.kind = None # type: Optional[str] + self.kind: Optional[str] = None class AlertSimulatorBundlesRequestProperties(AlertSimulatorRequestProperties): @@ -420,7 +420,7 @@ def __init__( :paramtype bundles: list[str or ~azure.mgmt.security.v2022_01_01.models.BundleType] """ super().__init__(additional_properties=additional_properties, **kwargs) - self.kind = "Bundles" # type: str + self.kind: str = "Bundles" self.bundles = bundles @@ -470,7 +470,7 @@ class ResourceIdentifier(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.type = None # type: Optional[str] + self.type: Optional[str] = None class AzureResourceIdentifier(ResourceIdentifier): @@ -500,7 +500,7 @@ class AzureResourceIdentifier(ResourceIdentifier): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.type = "AzureResource" # type: str + self.type: str = "AzureResource" self.azure_resource_id = None @@ -620,7 +620,7 @@ class LogAnalyticsIdentifier(ResourceIdentifier): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.type = "LogAnalytics" # type: str + self.type: str = "LogAnalytics" self.workspace_id = None self.workspace_subscription_id = None self.workspace_resource_group = None diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/operations/__init__.py index 522898d37fc6..b3a334939bbd 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/operations/__init__.py @@ -9,7 +9,7 @@ from ._alerts_operations import AlertsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/operations/_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/operations/_alerts_operations.py index 8b4e64307f33..6e86b865bc48 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/operations/_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/operations/_alerts_operations.py @@ -47,7 +47,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,7 +73,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +90,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,7 +107,7 @@ def build_list_subscription_level_by_region_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,7 +121,7 @@ def build_list_subscription_level_by_region_request( "ascLocation": _SERIALIZER.url("asc_location", asc_location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -138,7 +138,7 @@ def build_list_resource_group_level_by_region_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -156,7 +156,7 @@ def build_list_resource_group_level_by_region_request( ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -173,7 +173,7 @@ def build_get_subscription_level_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -189,7 +189,7 @@ def build_get_subscription_level_request( "alertName": _SERIALIZER.url("alert_name", alert_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -206,7 +206,7 @@ def build_get_resource_group_level_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -225,7 +225,7 @@ def build_get_resource_group_level_request( "alertName": _SERIALIZER.url("alert_name", alert_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -242,7 +242,7 @@ def build_update_subscription_level_state_to_dismiss_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -258,7 +258,7 @@ def build_update_subscription_level_state_to_dismiss_request( "alertName": _SERIALIZER.url("alert_name", alert_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -275,7 +275,7 @@ def build_update_subscription_level_state_to_resolve_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -291,7 +291,7 @@ def build_update_subscription_level_state_to_resolve_request( "alertName": _SERIALIZER.url("alert_name", alert_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -308,7 +308,7 @@ def build_update_subscription_level_state_to_activate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +324,7 @@ def build_update_subscription_level_state_to_activate_request( "alertName": _SERIALIZER.url("alert_name", alert_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -341,7 +341,7 @@ def build_update_subscription_level_state_to_in_progress_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -357,7 +357,7 @@ def build_update_subscription_level_state_to_in_progress_request( "alertName": _SERIALIZER.url("alert_name", alert_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -374,7 +374,7 @@ def build_update_resource_group_level_state_to_resolve_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -393,7 +393,7 @@ def build_update_resource_group_level_state_to_resolve_request( "alertName": _SERIALIZER.url("alert_name", alert_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -410,7 +410,7 @@ def build_update_resource_group_level_state_to_dismiss_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -429,7 +429,7 @@ def build_update_resource_group_level_state_to_dismiss_request( "alertName": _SERIALIZER.url("alert_name", alert_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -446,7 +446,7 @@ def build_update_resource_group_level_state_to_activate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -465,7 +465,7 @@ def build_update_resource_group_level_state_to_activate_request( "alertName": _SERIALIZER.url("alert_name", alert_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -482,7 +482,7 @@ def build_update_resource_group_level_state_to_in_progress_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -501,7 +501,7 @@ def build_update_resource_group_level_state_to_in_progress_request( "alertName": _SERIALIZER.url("alert_name", alert_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -516,8 +516,8 @@ def build_simulate_request(asc_location: str, subscription_id: str, **kwargs: An _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -532,7 +532,7 @@ def build_simulate_request(asc_location: str, subscription_id: str, **kwargs: An "ascLocation": _SERIALIZER.url("asc_location", asc_location, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -576,8 +576,8 @@ def list(self, **kwargs: Any) -> Iterable["_models.Alert"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertList] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -598,7 +598,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -614,7 +614,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -622,13 +622,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -641,7 +641,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts"} @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Alert"]: @@ -658,8 +658,8 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertList] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -681,7 +681,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -697,7 +697,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -705,13 +705,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -724,7 +724,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts" + } @distributed_trace def list_subscription_level_by_region(self, asc_location: str, **kwargs: Any) -> Iterable["_models.Alert"]: @@ -742,8 +744,8 @@ def list_subscription_level_by_region(self, asc_location: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertList] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -765,7 +767,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -781,7 +783,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -789,13 +791,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -808,7 +810,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_subscription_level_by_region.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts"} # type: ignore + list_subscription_level_by_region.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts" + } @distributed_trace def list_resource_group_level_by_region( @@ -831,8 +835,8 @@ def list_resource_group_level_by_region( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertList] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[_models.AlertList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -855,7 +859,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -871,7 +875,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -879,13 +883,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("AlertList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -898,7 +902,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_resource_group_level_by_region.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts"} # type: ignore + list_resource_group_level_by_region.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts" + } @distributed_trace def get_subscription_level(self, asc_location: str, alert_name: str, **kwargs: Any) -> _models.Alert: @@ -925,8 +931,8 @@ def get_subscription_level(self, asc_location: str, alert_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Alert] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[_models.Alert] = kwargs.pop("cls", None) request = build_get_subscription_level_request( asc_location=asc_location, @@ -938,9 +944,9 @@ def get_subscription_level(self, asc_location: str, alert_name: str, **kwargs: A params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -957,7 +963,9 @@ def get_subscription_level(self, asc_location: str, alert_name: str, **kwargs: A return deserialized - get_subscription_level.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}"} # type: ignore + get_subscription_level.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}" + } @distributed_trace def get_resource_group_level( @@ -989,8 +997,8 @@ def get_resource_group_level( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Alert] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[_models.Alert] = kwargs.pop("cls", None) request = build_get_resource_group_level_request( resource_group_name=resource_group_name, @@ -1003,9 +1011,9 @@ def get_resource_group_level( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1022,7 +1030,9 @@ def get_resource_group_level( return deserialized - get_resource_group_level.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}"} # type: ignore + get_resource_group_level.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}" + } @distributed_trace def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements @@ -1051,8 +1061,8 @@ def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_subscription_level_state_to_dismiss_request( asc_location=asc_location, @@ -1064,9 +1074,9 @@ def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1079,7 +1089,9 @@ def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent- if cls: return cls(pipeline_response, None, {}) - update_subscription_level_state_to_dismiss.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss"} # type: ignore + update_subscription_level_state_to_dismiss.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss" + } @distributed_trace def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent-return-statements @@ -1108,8 +1120,8 @@ def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent- _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_subscription_level_state_to_resolve_request( asc_location=asc_location, @@ -1121,9 +1133,9 @@ def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent- params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1136,7 +1148,9 @@ def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent- if cls: return cls(pipeline_response, None, {}) - update_subscription_level_state_to_resolve.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve"} # type: ignore + update_subscription_level_state_to_resolve.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve" + } @distributed_trace def update_subscription_level_state_to_activate( # pylint: disable=inconsistent-return-statements @@ -1165,8 +1179,8 @@ def update_subscription_level_state_to_activate( # pylint: disable=inconsistent _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_subscription_level_state_to_activate_request( asc_location=asc_location, @@ -1178,9 +1192,9 @@ def update_subscription_level_state_to_activate( # pylint: disable=inconsistent params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1193,7 +1207,9 @@ def update_subscription_level_state_to_activate( # pylint: disable=inconsistent if cls: return cls(pipeline_response, None, {}) - update_subscription_level_state_to_activate.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate"} # type: ignore + update_subscription_level_state_to_activate.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate" + } @distributed_trace def update_subscription_level_state_to_in_progress( # pylint: disable=inconsistent-return-statements @@ -1222,8 +1238,8 @@ def update_subscription_level_state_to_in_progress( # pylint: disable=inconsist _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_subscription_level_state_to_in_progress_request( asc_location=asc_location, @@ -1235,9 +1251,9 @@ def update_subscription_level_state_to_in_progress( # pylint: disable=inconsist params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1250,7 +1266,9 @@ def update_subscription_level_state_to_in_progress( # pylint: disable=inconsist if cls: return cls(pipeline_response, None, {}) - update_subscription_level_state_to_in_progress.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress"} # type: ignore + update_subscription_level_state_to_in_progress.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress" + } @distributed_trace def update_resource_group_level_state_to_resolve( # pylint: disable=inconsistent-return-statements @@ -1282,8 +1300,8 @@ def update_resource_group_level_state_to_resolve( # pylint: disable=inconsisten _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_resource_group_level_state_to_resolve_request( resource_group_name=resource_group_name, @@ -1296,9 +1314,9 @@ def update_resource_group_level_state_to_resolve( # pylint: disable=inconsisten params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1311,7 +1329,9 @@ def update_resource_group_level_state_to_resolve( # pylint: disable=inconsisten if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_state_to_resolve.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve"} # type: ignore + update_resource_group_level_state_to_resolve.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve" + } @distributed_trace def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements @@ -1343,8 +1363,8 @@ def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsisten _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_resource_group_level_state_to_dismiss_request( resource_group_name=resource_group_name, @@ -1357,9 +1377,9 @@ def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsisten params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1372,7 +1392,9 @@ def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsisten if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_state_to_dismiss.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss"} # type: ignore + update_resource_group_level_state_to_dismiss.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss" + } @distributed_trace def update_resource_group_level_state_to_activate( # pylint: disable=inconsistent-return-statements @@ -1404,8 +1426,8 @@ def update_resource_group_level_state_to_activate( # pylint: disable=inconsiste _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_resource_group_level_state_to_activate_request( resource_group_name=resource_group_name, @@ -1418,9 +1440,9 @@ def update_resource_group_level_state_to_activate( # pylint: disable=inconsiste params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1433,7 +1455,9 @@ def update_resource_group_level_state_to_activate( # pylint: disable=inconsiste if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_state_to_activate.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate"} # type: ignore + update_resource_group_level_state_to_activate.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate" + } @distributed_trace def update_resource_group_level_state_to_in_progress( # pylint: disable=inconsistent-return-statements @@ -1465,8 +1489,8 @@ def update_resource_group_level_state_to_in_progress( # pylint: disable=inconsi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_update_resource_group_level_state_to_in_progress_request( resource_group_name=resource_group_name, @@ -1479,9 +1503,9 @@ def update_resource_group_level_state_to_in_progress( # pylint: disable=inconsi params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1494,7 +1518,9 @@ def update_resource_group_level_state_to_in_progress( # pylint: disable=inconsi if cls: return cls(pipeline_response, None, {}) - update_resource_group_level_state_to_in_progress.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress"} # type: ignore + update_resource_group_level_state_to_in_progress.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress" + } def _simulate_initial( # pylint: disable=inconsistent-return-statements self, @@ -1513,9 +1539,9 @@ def _simulate_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + 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 @@ -1537,9 +1563,9 @@ def _simulate_initial( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -1552,7 +1578,9 @@ def _simulate_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _simulate_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate"} # type: ignore + _simulate_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate" + } @overload def begin_simulate( @@ -1653,12 +1681,12 @@ def begin_simulate( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: Literal["2022-01-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + api_version: Literal["2022-01-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._simulate_initial( # type: ignore asc_location=asc_location, @@ -1677,9 +1705,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast( + polling_method: PollingMethod = cast( PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) - ) # type: PollingMethod + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -1691,6 +1719,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_simulate.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate"} # type: ignore + begin_simulate.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_configuration.py index d57df2945327..f279c56dd891 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_configuration.py @@ -35,31 +35,35 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Azure subscription ID. Required. :type subscription_id: str + :param management_group_id: Azure Management Group ID. Required. + :type management_group_id: str :keyword api_version: Api Version. Default value is "2022-01-01-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + def __init__( + self, credential: "TokenCredential", subscription_id: str, management_group_id: str, **kwargs: Any + ) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-01-01-preview") # type: Literal["2022-01-01-preview"] + api_version: Literal["2022-01-01-preview"] = kwargs.pop("api_version", "2022-01-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") + if management_group_id is None: + raise ValueError("Parameter 'management_group_id' must not be None.") self.credential = credential self.subscription_id = subscription_id + self.management_group_id = management_group_id self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_metadata.json index 557420da04a7..91b14f880ad1 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_metadata.json @@ -26,6 +26,12 @@ "description": "Azure subscription ID. Required.", "docstring_type": "str", "required": true + }, + "management_group_id": { + "signature": "management_group_id: str,", + "description": "Azure Management Group ID. Required.", + "docstring_type": "str", + "required": true } }, "async": { @@ -40,15 +46,21 @@ "description": "Azure subscription ID. Required.", "docstring_type": "str", "required": true + }, + "management_group_id": { + "signature": "management_group_id: str,", + "description": "Azure Management Group ID. Required.", + "docstring_type": "str", + "required": true } }, "constant": { }, - "call": "credential, subscription_id", + "call": "credential, subscription_id, management_group_id", "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +72,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false @@ -101,8 +113,11 @@ "governance_rules": "GovernanceRulesOperations", "security_connector_governance_rule": "SecurityConnectorGovernanceRuleOperations", "security_connector_governance_rules": "SecurityConnectorGovernanceRulesOperations", - "subscription_governance_rules_execute_status": "SubscriptionGovernanceRulesExecuteStatusOperations", - "security_connector_governance_rules_execute_status": "SecurityConnectorGovernanceRulesExecuteStatusOperations", + "management_group_governance_rule": "ManagementGroupGovernanceRuleOperations", + "management_group_governance_rules": "ManagementGroupGovernanceRulesOperations", + "subscription_governance_rules_operation_result": "SubscriptionGovernanceRulesOperationResultOperations", + "security_connector_governance_rules_operation_result": "SecurityConnectorGovernanceRulesOperationResultOperations", + "management_group_governance_rules_operation_result": "ManagementGroupGovernanceRulesOperationResultOperations", "governance_assignments": "GovernanceAssignmentsOperations" } } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_security_center.py index a12a5f9f4461..673e1856f2ec 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_security_center.py @@ -12,17 +12,20 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ( GovernanceAssignmentsOperations, GovernanceRuleOperations, GovernanceRulesOperations, + ManagementGroupGovernanceRuleOperations, + ManagementGroupGovernanceRulesOperationResultOperations, + ManagementGroupGovernanceRulesOperations, SecurityConnectorGovernanceRuleOperations, - SecurityConnectorGovernanceRulesExecuteStatusOperations, + SecurityConnectorGovernanceRulesOperationResultOperations, SecurityConnectorGovernanceRulesOperations, - SubscriptionGovernanceRulesExecuteStatusOperations, + SubscriptionGovernanceRulesOperationResultOperations, ) if TYPE_CHECKING: @@ -46,14 +49,24 @@ class SecurityCenter: # pylint: disable=client-accepts-api-version-keyword,too- operations :vartype security_connector_governance_rules: azure.mgmt.security.v2022_01_01_preview.operations.SecurityConnectorGovernanceRulesOperations - :ivar subscription_governance_rules_execute_status: - SubscriptionGovernanceRulesExecuteStatusOperations operations - :vartype subscription_governance_rules_execute_status: - azure.mgmt.security.v2022_01_01_preview.operations.SubscriptionGovernanceRulesExecuteStatusOperations - :ivar security_connector_governance_rules_execute_status: - SecurityConnectorGovernanceRulesExecuteStatusOperations operations - :vartype security_connector_governance_rules_execute_status: - azure.mgmt.security.v2022_01_01_preview.operations.SecurityConnectorGovernanceRulesExecuteStatusOperations + :ivar management_group_governance_rule: ManagementGroupGovernanceRuleOperations operations + :vartype management_group_governance_rule: + azure.mgmt.security.v2022_01_01_preview.operations.ManagementGroupGovernanceRuleOperations + :ivar management_group_governance_rules: ManagementGroupGovernanceRulesOperations operations + :vartype management_group_governance_rules: + azure.mgmt.security.v2022_01_01_preview.operations.ManagementGroupGovernanceRulesOperations + :ivar subscription_governance_rules_operation_result: + SubscriptionGovernanceRulesOperationResultOperations operations + :vartype subscription_governance_rules_operation_result: + azure.mgmt.security.v2022_01_01_preview.operations.SubscriptionGovernanceRulesOperationResultOperations + :ivar security_connector_governance_rules_operation_result: + SecurityConnectorGovernanceRulesOperationResultOperations operations + :vartype security_connector_governance_rules_operation_result: + azure.mgmt.security.v2022_01_01_preview.operations.SecurityConnectorGovernanceRulesOperationResultOperations + :ivar management_group_governance_rules_operation_result: + ManagementGroupGovernanceRulesOperationResultOperations operations + :vartype management_group_governance_rules_operation_result: + azure.mgmt.security.v2022_01_01_preview.operations.ManagementGroupGovernanceRulesOperationResultOperations :ivar governance_assignments: GovernanceAssignmentsOperations operations :vartype governance_assignments: azure.mgmt.security.v2022_01_01_preview.operations.GovernanceAssignmentsOperations @@ -61,6 +74,8 @@ class SecurityCenter: # pylint: disable=client-accepts-api-version-keyword,too- :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Azure subscription ID. Required. :type subscription_id: str + :param management_group_id: Azure Management Group ID. Required. + :type management_group_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str :keyword api_version: Api Version. Default value is "2022-01-01-preview". Note that overriding @@ -74,13 +89,16 @@ def __init__( self, credential: "TokenCredential", subscription_id: str, + management_group_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._config = SecurityCenterConfiguration( + credential=credential, subscription_id=subscription_id, management_group_id=management_group_id, **kwargs + ) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -94,11 +112,22 @@ def __init__( self.security_connector_governance_rules = SecurityConnectorGovernanceRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.subscription_governance_rules_execute_status = SubscriptionGovernanceRulesExecuteStatusOperations( + self.management_group_governance_rule = ManagementGroupGovernanceRuleOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.management_group_governance_rules = ManagementGroupGovernanceRulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.subscription_governance_rules_operation_result = SubscriptionGovernanceRulesOperationResultOperations( self._client, self._config, self._serialize, self._deserialize ) - self.security_connector_governance_rules_execute_status = ( - SecurityConnectorGovernanceRulesExecuteStatusOperations( + self.security_connector_governance_rules_operation_result = ( + SecurityConnectorGovernanceRulesOperationResultOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.management_group_governance_rules_operation_result = ( + ManagementGroupGovernanceRulesOperationResultOperations( self._client, self._config, self._serialize, self._deserialize ) ) @@ -128,15 +157,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/_configuration.py index b57abce4011b..ed0f6d214d72 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/_configuration.py @@ -35,22 +35,29 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Azure subscription ID. Required. :type subscription_id: str + :param management_group_id: Azure Management Group ID. Required. + :type management_group_id: str :keyword api_version: Api Version. Default value is "2022-01-01-preview". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + def __init__( + self, credential: "AsyncTokenCredential", subscription_id: str, management_group_id: str, **kwargs: Any + ) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-01-01-preview") # type: Literal["2022-01-01-preview"] + api_version: Literal["2022-01-01-preview"] = kwargs.pop("api_version", "2022-01-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") + if management_group_id is None: + raise ValueError("Parameter 'management_group_id' must not be None.") self.credential = credential self.subscription_id = subscription_id + self.management_group_id = management_group_id self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/_security_center.py index e2595715763a..15257d485885 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/_security_center.py @@ -12,17 +12,20 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ( GovernanceAssignmentsOperations, GovernanceRuleOperations, GovernanceRulesOperations, + ManagementGroupGovernanceRuleOperations, + ManagementGroupGovernanceRulesOperationResultOperations, + ManagementGroupGovernanceRulesOperations, SecurityConnectorGovernanceRuleOperations, - SecurityConnectorGovernanceRulesExecuteStatusOperations, + SecurityConnectorGovernanceRulesOperationResultOperations, SecurityConnectorGovernanceRulesOperations, - SubscriptionGovernanceRulesExecuteStatusOperations, + SubscriptionGovernanceRulesOperationResultOperations, ) if TYPE_CHECKING: @@ -46,14 +49,24 @@ class SecurityCenter: # pylint: disable=client-accepts-api-version-keyword,too- operations :vartype security_connector_governance_rules: azure.mgmt.security.v2022_01_01_preview.aio.operations.SecurityConnectorGovernanceRulesOperations - :ivar subscription_governance_rules_execute_status: - SubscriptionGovernanceRulesExecuteStatusOperations operations - :vartype subscription_governance_rules_execute_status: - azure.mgmt.security.v2022_01_01_preview.aio.operations.SubscriptionGovernanceRulesExecuteStatusOperations - :ivar security_connector_governance_rules_execute_status: - SecurityConnectorGovernanceRulesExecuteStatusOperations operations - :vartype security_connector_governance_rules_execute_status: - azure.mgmt.security.v2022_01_01_preview.aio.operations.SecurityConnectorGovernanceRulesExecuteStatusOperations + :ivar management_group_governance_rule: ManagementGroupGovernanceRuleOperations operations + :vartype management_group_governance_rule: + azure.mgmt.security.v2022_01_01_preview.aio.operations.ManagementGroupGovernanceRuleOperations + :ivar management_group_governance_rules: ManagementGroupGovernanceRulesOperations operations + :vartype management_group_governance_rules: + azure.mgmt.security.v2022_01_01_preview.aio.operations.ManagementGroupGovernanceRulesOperations + :ivar subscription_governance_rules_operation_result: + SubscriptionGovernanceRulesOperationResultOperations operations + :vartype subscription_governance_rules_operation_result: + azure.mgmt.security.v2022_01_01_preview.aio.operations.SubscriptionGovernanceRulesOperationResultOperations + :ivar security_connector_governance_rules_operation_result: + SecurityConnectorGovernanceRulesOperationResultOperations operations + :vartype security_connector_governance_rules_operation_result: + azure.mgmt.security.v2022_01_01_preview.aio.operations.SecurityConnectorGovernanceRulesOperationResultOperations + :ivar management_group_governance_rules_operation_result: + ManagementGroupGovernanceRulesOperationResultOperations operations + :vartype management_group_governance_rules_operation_result: + azure.mgmt.security.v2022_01_01_preview.aio.operations.ManagementGroupGovernanceRulesOperationResultOperations :ivar governance_assignments: GovernanceAssignmentsOperations operations :vartype governance_assignments: azure.mgmt.security.v2022_01_01_preview.aio.operations.GovernanceAssignmentsOperations @@ -61,6 +74,8 @@ class SecurityCenter: # pylint: disable=client-accepts-api-version-keyword,too- :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Azure subscription ID. Required. :type subscription_id: str + :param management_group_id: Azure Management Group ID. Required. + :type management_group_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str :keyword api_version: Api Version. Default value is "2022-01-01-preview". Note that overriding @@ -74,13 +89,16 @@ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, + management_group_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._config = SecurityCenterConfiguration( + credential=credential, subscription_id=subscription_id, management_group_id=management_group_id, **kwargs + ) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -94,11 +112,22 @@ def __init__( self.security_connector_governance_rules = SecurityConnectorGovernanceRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.subscription_governance_rules_execute_status = SubscriptionGovernanceRulesExecuteStatusOperations( + self.management_group_governance_rule = ManagementGroupGovernanceRuleOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.management_group_governance_rules = ManagementGroupGovernanceRulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.subscription_governance_rules_operation_result = SubscriptionGovernanceRulesOperationResultOperations( self._client, self._config, self._serialize, self._deserialize ) - self.security_connector_governance_rules_execute_status = ( - SecurityConnectorGovernanceRulesExecuteStatusOperations( + self.security_connector_governance_rules_operation_result = ( + SecurityConnectorGovernanceRulesOperationResultOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.management_group_governance_rules_operation_result = ( + ManagementGroupGovernanceRulesOperationResultOperations( self._client, self._config, self._serialize, self._deserialize ) ) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/__init__.py index 504e37b2c881..79881e12e604 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/__init__.py @@ -10,14 +10,21 @@ from ._governance_rules_operations import GovernanceRulesOperations from ._security_connector_governance_rule_operations import SecurityConnectorGovernanceRuleOperations from ._security_connector_governance_rules_operations import SecurityConnectorGovernanceRulesOperations -from ._subscription_governance_rules_execute_status_operations import SubscriptionGovernanceRulesExecuteStatusOperations -from ._security_connector_governance_rules_execute_status_operations import ( - SecurityConnectorGovernanceRulesExecuteStatusOperations, +from ._management_group_governance_rule_operations import ManagementGroupGovernanceRuleOperations +from ._management_group_governance_rules_operations import ManagementGroupGovernanceRulesOperations +from ._subscription_governance_rules_operation_result_operations import ( + SubscriptionGovernanceRulesOperationResultOperations, +) +from ._security_connector_governance_rules_operation_result_operations import ( + SecurityConnectorGovernanceRulesOperationResultOperations, +) +from ._management_group_governance_rules_operation_result_operations import ( + ManagementGroupGovernanceRulesOperationResultOperations, ) from ._governance_assignments_operations import GovernanceAssignmentsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -25,8 +32,11 @@ "GovernanceRulesOperations", "SecurityConnectorGovernanceRuleOperations", "SecurityConnectorGovernanceRulesOperations", - "SubscriptionGovernanceRulesExecuteStatusOperations", - "SecurityConnectorGovernanceRulesExecuteStatusOperations", + "ManagementGroupGovernanceRuleOperations", + "ManagementGroupGovernanceRulesOperations", + "SubscriptionGovernanceRulesOperationResultOperations", + "SecurityConnectorGovernanceRulesOperationResultOperations", + "ManagementGroupGovernanceRulesOperationResultOperations", "GovernanceAssignmentsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_governance_assignments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_governance_assignments_operations.py index 7be4f81e6edc..775c39bb48b0 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_governance_assignments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_governance_assignments_operations.py @@ -65,13 +65,13 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list(self, scope: str, assessment_name: str, **kwargs: Any) -> AsyncIterable["_models.GovernanceAssignment"]: - """Get security governanceAssignments on all your resources inside a scope. + """Get governance assignments on all of your resources inside a scope. :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). Required. :type scope: str - :param assessment_name: The Assessment Key - Unique key for the assessment type. Required. + :param assessment_name: The Assessment Key - A unique key for the assessment type. Required. :type assessment_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GovernanceAssignment or the result of @@ -83,10 +83,10 @@ def list(self, scope: str, assessment_name: str, **kwargs: Any) -> AsyncIterable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceAssignmentsList] + ) + cls: ClsType[_models.GovernanceAssignmentsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -108,7 +108,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -124,7 +124,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -132,13 +132,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("GovernanceAssignmentsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -151,7 +151,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments"} @distributed_trace_async async def get( @@ -163,10 +163,10 @@ async def get( (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). Required. :type scope: str - :param assessment_name: The Assessment Key - Unique key for the assessment type. Required. + :param assessment_name: The Assessment Key - A unique key for the assessment type. Required. :type assessment_name: str - :param assignment_key: The security governance assignment key - the assessment key of the - required governance assignment. Required. + :param assignment_key: The governance assignment key - the assessment key of the required + governance assignment. Required. :type assignment_key: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GovernanceAssignment or the result of cls(response) @@ -184,10 +184,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceAssignment] + ) + cls: ClsType[_models.GovernanceAssignment] = kwargs.pop("cls", None) request = build_get_request( scope=scope, @@ -199,9 +199,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -218,7 +218,9 @@ async def get( return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}"} # type: ignore + get.metadata = { + "url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}" + } @overload async def create_or_update( @@ -231,18 +233,18 @@ async def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.GovernanceAssignment: - """Creates or update a security GovernanceAssignment on the given subscription. + """Creates or updates a governance assignment on the given subscription. :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). Required. :type scope: str - :param assessment_name: The Assessment Key - Unique key for the assessment type. Required. + :param assessment_name: The Assessment Key - A unique key for the assessment type. Required. :type assessment_name: str - :param assignment_key: The security governance assignment key - the assessment key of the - required governance assignment. Required. + :param assignment_key: The governance assignment key - the assessment key of the required + governance assignment. Required. :type assignment_key: str - :param governance_assignment: GovernanceAssignment over a subscription scope. Required. + :param governance_assignment: Governance assignment over a subscription scope. Required. :type governance_assignment: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceAssignment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -265,18 +267,18 @@ async def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.GovernanceAssignment: - """Creates or update a security GovernanceAssignment on the given subscription. + """Creates or updates a governance assignment on the given subscription. :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). Required. :type scope: str - :param assessment_name: The Assessment Key - Unique key for the assessment type. Required. + :param assessment_name: The Assessment Key - A unique key for the assessment type. Required. :type assessment_name: str - :param assignment_key: The security governance assignment key - the assessment key of the - required governance assignment. Required. + :param assignment_key: The governance assignment key - the assessment key of the required + governance assignment. Required. :type assignment_key: str - :param governance_assignment: GovernanceAssignment over a subscription scope. Required. + :param governance_assignment: Governance assignment over a subscription scope. Required. :type governance_assignment: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -296,19 +298,19 @@ async def create_or_update( governance_assignment: Union[_models.GovernanceAssignment, IO], **kwargs: Any ) -> _models.GovernanceAssignment: - """Creates or update a security GovernanceAssignment on the given subscription. + """Creates or updates a governance assignment on the given subscription. :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). Required. :type scope: str - :param assessment_name: The Assessment Key - Unique key for the assessment type. Required. + :param assessment_name: The Assessment Key - A unique key for the assessment type. Required. :type assessment_name: str - :param assignment_key: The security governance assignment key - the assessment key of the - required governance assignment. Required. + :param assignment_key: The governance assignment key - the assessment key of the required + governance assignment. Required. :type assignment_key: str - :param governance_assignment: GovernanceAssignment over a subscription scope. Is either a model - type or a IO type. Required. + :param governance_assignment: Governance assignment over a subscription scope. Is either a + model type or a IO type. Required. :type governance_assignment: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceAssignment or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -330,11 +332,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceAssignment] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GovernanceAssignment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -357,9 +359,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -376,11 +378,13 @@ async def create_or_update( deserialized = self._deserialize("GovernanceAssignment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}"} # type: ignore + create_or_update.metadata = { + "url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -392,10 +396,10 @@ async def delete( # pylint: disable=inconsistent-return-statements (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). Required. :type scope: str - :param assessment_name: The Assessment Key - Unique key for the assessment type. Required. + :param assessment_name: The Assessment Key - A unique key for the assessment type. Required. :type assessment_name: str - :param assignment_key: The security governance assignment key - the assessment key of the - required governance assignment. Required. + :param assignment_key: The governance assignment key - the assessment key of the required + governance assignment. Required. :type assignment_key: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) @@ -413,10 +417,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( scope=scope, @@ -428,9 +432,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -443,4 +447,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}"} # type: ignore + delete.metadata = { + "url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_governance_rule_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_governance_rule_operations.py index 2927ce84c770..5fe0c7f1199a 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_governance_rule_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_governance_rule_operations.py @@ -59,7 +59,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.GovernanceRule"]: - """Get a list of all relevant governanceRules over a subscription level scope. + """Get a list of the governance rules on the subscription level scope. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GovernanceRule or the result of cls(response) @@ -70,10 +70,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.GovernanceRule"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceRuleList] + ) + cls: ClsType[_models.GovernanceRuleList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -94,7 +94,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -110,7 +110,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -118,13 +118,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("GovernanceRuleList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -137,4 +137,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_governance_rules_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_governance_rules_operations.py index d0f4a162976f..e7f7d12defb3 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_governance_rules_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_governance_rules_operations.py @@ -32,6 +32,7 @@ build_create_or_update_request, build_delete_request, build_get_request, + build_rule_id_execute_single_management_group_request, build_rule_id_execute_single_security_connector_request, build_rule_id_execute_single_subscription_request, ) @@ -65,9 +66,9 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def get(self, rule_id: str, **kwargs: Any) -> _models.GovernanceRule: - """Get a specific governanceRule for the requested scope by ruleId. + """Get a specific governance rule for the requested scope by ruleId. - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -86,10 +87,10 @@ async def get(self, rule_id: str, **kwargs: Any) -> _models.GovernanceRule: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceRule] + ) + cls: ClsType[_models.GovernanceRule] = kwargs.pop("cls", None) request = build_get_request( rule_id=rule_id, @@ -100,9 +101,9 @@ async def get(self, rule_id: str, **kwargs: Any) -> _models.GovernanceRule: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -119,7 +120,7 @@ async def get(self, rule_id: str, **kwargs: Any) -> _models.GovernanceRule: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}"} @overload async def create_or_update( @@ -130,12 +131,12 @@ async def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.GovernanceRule: - """Creates or update a security GovernanceRule on the given subscription. + """Creates or updates a governance rule on a subscription. - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param governance_rule: GovernanceRule over a subscription scope. Required. + :param governance_rule: Governance rule over a given scope. Required. :type governance_rule: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -150,12 +151,12 @@ async def create_or_update( async def create_or_update( self, rule_id: str, governance_rule: IO, *, content_type: str = "application/json", **kwargs: Any ) -> _models.GovernanceRule: - """Creates or update a security GovernanceRule on the given subscription. + """Creates or updates a governance rule on a subscription. - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param governance_rule: GovernanceRule over a subscription scope. Required. + :param governance_rule: Governance rule over a given scope. Required. :type governance_rule: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -170,13 +171,13 @@ async def create_or_update( async def create_or_update( self, rule_id: str, governance_rule: Union[_models.GovernanceRule, IO], **kwargs: Any ) -> _models.GovernanceRule: - """Creates or update a security GovernanceRule on the given subscription. + """Creates or updates a governance rule on a subscription. - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param governance_rule: GovernanceRule over a subscription scope. Is either a model type or a - IO type. Required. + :param governance_rule: Governance rule over a given scope. Is either a model type or a IO + type. Required. :type governance_rule: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -197,11 +198,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceRule] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GovernanceRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -223,9 +224,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -242,17 +243,19 @@ async def create_or_update( deserialized = self._deserialize("GovernanceRule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}" + } @distributed_trace_async async def delete(self, rule_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete a GovernanceRule over a given scope. + """Delete a Governance rule over a given scope. - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -271,10 +274,10 @@ async def delete(self, rule_id: str, **kwargs: Any) -> None: # pylint: disable= _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( rule_id=rule_id, @@ -285,9 +288,9 @@ async def delete(self, rule_id: str, **kwargs: Any) -> None: # pylint: disable= params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -300,7 +303,7 @@ async def delete(self, rule_id: str, **kwargs: Any) -> None: # pylint: disable= if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}"} # type: ignore + delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}"} async def _rule_id_execute_single_subscription_initial( # pylint: disable=inconsistent-return-statements self, @@ -319,11 +322,11 @@ async def _rule_id_execute_single_subscription_initial( # pylint: disable=incon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -348,9 +351,9 @@ async def _rule_id_execute_single_subscription_initial( # pylint: disable=incon params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -366,7 +369,9 @@ async def _rule_id_execute_single_subscription_initial( # pylint: disable=incon if cls: return cls(pipeline_response, None, response_headers) - _rule_id_execute_single_subscription_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute"} # type: ignore + _rule_id_execute_single_subscription_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" + } @overload async def begin_rule_id_execute_single_subscription( @@ -377,13 +382,13 @@ async def begin_rule_id_execute_single_subscription( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: - """Execute a security GovernanceRule on the given subscription. + """Execute a governance rule on a subscription. - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param execute_governance_rule_params: GovernanceRule over a subscription scope. Default value - is None. + :param execute_governance_rule_params: Execute governance rule over a given scope. Default + value is None. :type execute_governance_rule_params: ~azure.mgmt.security.v2022_01_01_preview.models.ExecuteGovernanceRuleParams :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -411,13 +416,13 @@ async def begin_rule_id_execute_single_subscription( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: - """Execute a security GovernanceRule on the given subscription. + """Execute a governance rule on a subscription. - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param execute_governance_rule_params: GovernanceRule over a subscription scope. Default value - is None. + :param execute_governance_rule_params: Execute governance rule over a given scope. Default + value is None. :type execute_governance_rule_params: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -442,12 +447,12 @@ async def begin_rule_id_execute_single_subscription( execute_governance_rule_params: Optional[Union[_models.ExecuteGovernanceRuleParams, IO]] = None, **kwargs: Any ) -> AsyncLROPoller[None]: - """Execute a security GovernanceRule on the given subscription. + """Execute a governance rule on a subscription. - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param execute_governance_rule_params: GovernanceRule over a subscription scope. Is either a + :param execute_governance_rule_params: Execute governance rule over a given scope. Is either a model type or a IO type. Default value is None. :type execute_governance_rule_params: ~azure.mgmt.security.v2022_01_01_preview.models.ExecuteGovernanceRuleParams or IO @@ -469,14 +474,14 @@ async def begin_rule_id_execute_single_subscription( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._rule_id_execute_single_subscription_initial( # type: ignore rule_id=rule_id, @@ -495,7 +500,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: @@ -507,9 +514,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_rule_id_execute_single_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute"} # type: ignore + begin_rule_id_execute_single_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" + } async def _rule_id_execute_single_security_connector_initial( # pylint: disable=inconsistent-return-statements self, @@ -530,11 +539,11 @@ async def _rule_id_execute_single_security_connector_initial( # pylint: disable _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -561,9 +570,9 @@ async def _rule_id_execute_single_security_connector_initial( # pylint: disable params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -579,7 +588,9 @@ async def _rule_id_execute_single_security_connector_initial( # pylint: disable if cls: return cls(pipeline_response, None, response_headers) - _rule_id_execute_single_security_connector_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/execute"} # type: ignore + _rule_id_execute_single_security_connector_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" + } @overload async def begin_rule_id_execute_single_security_connector( @@ -592,18 +603,18 @@ async def begin_rule_id_execute_single_security_connector( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: - """Execute a security GovernanceRule on the given security connector. + """Execute a governance rule on the given security connector. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. Required. :type resource_group_name: str :param security_connector_name: The security connector name. Required. :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param execute_governance_rule_params: GovernanceRule over a subscription scope. Default value - is None. + :param execute_governance_rule_params: Execute governance rule over a given scope. Default + value is None. :type execute_governance_rule_params: ~azure.mgmt.security.v2022_01_01_preview.models.ExecuteGovernanceRuleParams :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -633,18 +644,18 @@ async def begin_rule_id_execute_single_security_connector( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: - """Execute a security GovernanceRule on the given security connector. + """Execute a governance rule on the given security connector. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. Required. :type resource_group_name: str :param security_connector_name: The security connector name. Required. :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param execute_governance_rule_params: GovernanceRule over a subscription scope. Default value - is None. + :param execute_governance_rule_params: Execute governance rule over a given scope. Default + value is None. :type execute_governance_rule_params: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -671,17 +682,17 @@ async def begin_rule_id_execute_single_security_connector( execute_governance_rule_params: Optional[Union[_models.ExecuteGovernanceRuleParams, IO]] = None, **kwargs: Any ) -> AsyncLROPoller[None]: - """Execute a security GovernanceRule on the given security connector. + """Execute a governance rule on the given security connector. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. Required. :type resource_group_name: str :param security_connector_name: The security connector name. Required. :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param execute_governance_rule_params: GovernanceRule over a subscription scope. Is either a + :param execute_governance_rule_params: Execute governance rule over a given scope. Is either a model type or a IO type. Default value is None. :type execute_governance_rule_params: ~azure.mgmt.security.v2022_01_01_preview.models.ExecuteGovernanceRuleParams or IO @@ -703,14 +714,14 @@ async def begin_rule_id_execute_single_security_connector( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._rule_id_execute_single_security_connector_initial( # type: ignore resource_group_name=resource_group_name, @@ -731,7 +742,224 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, 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_rule_id_execute_single_security_connector.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" + } + + async def _rule_id_execute_single_management_group_initial( # pylint: disable=inconsistent-return-statements + self, + rule_id: str, + execute_governance_rule_params: Optional[Union[_models.ExecuteGovernanceRuleParams, IO]] = None, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-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(execute_governance_rule_params, (IO, bytes)): + _content = execute_governance_rule_params + else: + if execute_governance_rule_params is not None: + _json = self._serialize.body(execute_governance_rule_params, "ExecuteGovernanceRuleParams") + else: + _json = None + + request = build_rule_id_execute_single_management_group_request( + rule_id=rule_id, + management_group_id=self._config.management_group_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._rule_id_execute_single_management_group_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + _rule_id_execute_single_management_group_initial.metadata = { + "url": "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" + } + + @overload + async def begin_rule_id_execute_single_management_group( + self, + rule_id: str, + execute_governance_rule_params: Optional[_models.ExecuteGovernanceRuleParams] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Execute governance rule on the given management group. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param execute_governance_rule_params: Execute governance rule over a given scope. Default + value is None. + :type execute_governance_rule_params: + ~azure.mgmt.security.v2022_01_01_preview.models.ExecuteGovernanceRuleParams + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_rule_id_execute_single_management_group( + self, + rule_id: str, + execute_governance_rule_params: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Execute governance rule on the given management group. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param execute_governance_rule_params: Execute governance rule over a given scope. Default + value is None. + :type execute_governance_rule_params: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_rule_id_execute_single_management_group( + self, + rule_id: str, + execute_governance_rule_params: Optional[Union[_models.ExecuteGovernanceRuleParams, IO]] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Execute governance rule on the given management group. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param execute_governance_rule_params: Execute governance rule over a given scope. Is either a + model type or a IO type. Default value is None. + :type execute_governance_rule_params: + ~azure.mgmt.security.v2022_01_01_preview.models.ExecuteGovernanceRuleParams or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-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) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._rule_id_execute_single_management_group_initial( # type: ignore + rule_id=rule_id, + execute_governance_rule_params=execute_governance_rule_params, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + 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: @@ -743,6 +971,8 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_rule_id_execute_single_security_connector.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/execute"} # type: ignore + begin_rule_id_execute_single_management_group.metadata = { + "url": "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_management_group_governance_rule_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_management_group_governance_rule_operations.py new file mode 100644 index 000000000000..9e46a8b95141 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_management_group_governance_rule_operations.py @@ -0,0 +1,142 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._management_group_governance_rule_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]] + + +class ManagementGroupGovernanceRuleOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.security.v2022_01_01_preview.aio.SecurityCenter`'s + :attr:`management_group_governance_rule` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + 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(self, **kwargs: Any) -> AsyncIterable["_models.GovernanceRule"]: + """Get a list of all relevant governance rules over a management group level scope. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GovernanceRule or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + cls: ClsType[_models.GovernanceRuleList] = 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_request( + management_group_id=self._config.management_group_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + 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("GovernanceRuleList", 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) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = 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.metadata = { + "url": "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_management_group_governance_rules_operation_result_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_management_group_governance_rules_operation_result_operations.py new file mode 100644 index 000000000000..b2f0a8574b42 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_management_group_governance_rules_operation_result_operations.py @@ -0,0 +1,129 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._management_group_governance_rules_operation_result_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]] + + +class ManagementGroupGovernanceRulesOperationResultOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.security.v2022_01_01_preview.aio.SecurityCenter`'s + :attr:`management_group_governance_rules_operation_result` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + 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_async + async def get( + self, rule_id: str, operation_id: str, **kwargs: Any + ) -> Optional[_models.OperationResultAutoGenerated]: + """Get governance rules long run operation result for the requested scope by ruleId and + operationId. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param operation_id: The governance rule execution key - unique key for the execution of + governance rule. Required. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationResultAutoGenerated or None or the result of cls(response) + :rtype: ~azure.mgmt.security.v2022_01_01_preview.models.OperationResultAutoGenerated or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + cls: ClsType[Optional[_models.OperationResultAutoGenerated]] = kwargs.pop("cls", None) + + request = build_get_request( + rule_id=rule_id, + operation_id=operation_id, + management_group_id=self._config.management_group_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **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("OperationResultAutoGenerated", 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 + + get.metadata = { + "url": "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_management_group_governance_rules_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_management_group_governance_rules_operations.py new file mode 100644 index 000000000000..3db9c0231b61 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_management_group_governance_rules_operations.py @@ -0,0 +1,367 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._management_group_governance_rules_operations import ( + build_create_or_update_request, + build_delete_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]] + + +class ManagementGroupGovernanceRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.security.v2022_01_01_preview.aio.SecurityCenter`'s + :attr:`management_group_governance_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + 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_async + async def get(self, rule_id: str, **kwargs: Any) -> _models.GovernanceRule: + """Get a specific governance rule for the requested scope by ruleId. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GovernanceRule or the result of cls(response) + :rtype: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + cls: ClsType[_models.GovernanceRule] = kwargs.pop("cls", None) + + request = build_get_request( + rule_id=rule_id, + management_group_id=self._config.management_group_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GovernanceRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}" + } + + @overload + async def create_or_update( + self, + rule_id: str, + governance_rule: _models.GovernanceRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GovernanceRule: + """Creates or updates governance rule on the given management group. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param governance_rule: Governance rule over a given scope. Required. + :type governance_rule: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GovernanceRule or the result of cls(response) + :rtype: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, rule_id: str, governance_rule: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.GovernanceRule: + """Creates or updates governance rule on the given management group. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param governance_rule: Governance rule over a given scope. Required. + :type governance_rule: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GovernanceRule or the result of cls(response) + :rtype: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, rule_id: str, governance_rule: Union[_models.GovernanceRule, IO], **kwargs: Any + ) -> _models.GovernanceRule: + """Creates or updates governance rule on the given management group. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param governance_rule: Governance rule over a given scope. Is either a model type or a IO + type. Required. + :type governance_rule: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GovernanceRule or the result of cls(response) + :rtype: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GovernanceRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(governance_rule, (IO, bytes)): + _content = governance_rule + else: + _json = self._serialize.body(governance_rule, "GovernanceRule") + + request = build_create_or_update_request( + rule_id=rule_id, + management_group_id=self._config.management_group_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.create_or_update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("GovernanceRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("GovernanceRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + create_or_update.metadata = { + "url": "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}" + } + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, rule_id: str, **kwargs: Any + ) -> None: + 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: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + rule_id=rule_id, + management_group_id=self._config.management_group_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = { + "url": "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}" + } + + @distributed_trace_async + async def begin_delete(self, rule_id: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete a Governance rule over a given scope. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + rule_id=rule_id, + 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): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + 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_delete.metadata = { + "url": "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_security_connector_governance_rule_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_security_connector_governance_rule_operations.py index b7e5ea958c44..8d34fafcb72b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_security_connector_governance_rule_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_security_connector_governance_rule_operations.py @@ -61,7 +61,7 @@ def __init__(self, *args, **kwargs) -> None: def list( self, resource_group_name: str, security_connector_name: str, **kwargs: Any ) -> AsyncIterable["_models.GovernanceRule"]: - """Get a list of all relevant governanceRules over a security connector level scope. + """Get a list of all relevant governance rules over a security connector level scope. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. Required. @@ -77,10 +77,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceRuleList] + ) + cls: ClsType[_models.GovernanceRuleList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -103,7 +103,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -119,7 +119,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -127,13 +127,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("GovernanceRuleList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -146,4 +146,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_security_connector_governance_rules_execute_status_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_security_connector_governance_rules_execute_status_operations.py deleted file mode 100644 index f11ac5a5538a..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_security_connector_governance_rules_execute_status_operations.py +++ /dev/null @@ -1,195 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._security_connector_governance_rules_execute_status_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]] - - -class SecurityConnectorGovernanceRulesExecuteStatusOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.security.v2022_01_01_preview.aio.SecurityCenter`'s - :attr:`security_connector_governance_rules_execute_status` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") - - async def _get_initial( - self, resource_group_name: str, security_connector_name: str, rule_id: str, operation_id: str, **kwargs: Any - ) -> Optional[_models.ExecuteRuleStatus]: - 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ExecuteRuleStatus]] - - request = build_get_request( - resource_group_name=resource_group_name, - security_connector_name=security_connector_name, - rule_id=rule_id, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._get_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **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("ExecuteRuleStatus", 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 - - _get_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}"} # type: ignore - - @distributed_trace_async - async def begin_get( - self, resource_group_name: str, security_connector_name: str, rule_id: str, operation_id: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ExecuteRuleStatus]: - """Get a specific governanceRule execution status for the requested scope by ruleId and - operationId. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. Required. - :type resource_group_name: str - :param security_connector_name: The security connector name. Required. - :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. - Required. - :type rule_id: str - :param operation_id: The security GovernanceRule execution key - unique key for the execution - of GovernanceRule. Required. - :type operation_id: 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 ExecuteRuleStatus or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.security.v2022_01_01_preview.models.ExecuteRuleStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExecuteRuleStatus] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._get_initial( # type: ignore - resource_group_name=resource_group_name, - security_connector_name=security_connector_name, - rule_id=rule_id, - operation_id=operation_id, - 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("ExecuteRuleStatus", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - 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) - - begin_get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}"} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_security_connector_governance_rules_operation_result_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_security_connector_governance_rules_operation_result_operations.py new file mode 100644 index 000000000000..9203711b3d5a --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_security_connector_governance_rules_operation_result_operations.py @@ -0,0 +1,136 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._security_connector_governance_rules_operation_result_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]] + + +class SecurityConnectorGovernanceRulesOperationResultOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.security.v2022_01_01_preview.aio.SecurityCenter`'s + :attr:`security_connector_governance_rules_operation_result` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + 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_async + async def get( + self, resource_group_name: str, security_connector_name: str, rule_id: str, operation_id: str, **kwargs: Any + ) -> Optional[_models.OperationResultAutoGenerated]: + """Get governance rule long run operation result for the requested scope by ruleId and + operationId. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. Required. + :type resource_group_name: str + :param security_connector_name: The security connector name. Required. + :type security_connector_name: str + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param operation_id: The governance rule execution key - unique key for the execution of + governance rule. Required. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationResultAutoGenerated or None or the result of cls(response) + :rtype: ~azure.mgmt.security.v2022_01_01_preview.models.OperationResultAutoGenerated or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + cls: ClsType[Optional[_models.OperationResultAutoGenerated]] = kwargs.pop("cls", None) + + request = build_get_request( + resource_group_name=resource_group_name, + security_connector_name=security_connector_name, + rule_id=rule_id, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **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("OperationResultAutoGenerated", 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 + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_security_connector_governance_rules_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_security_connector_governance_rules_operations.py index 8446d9e5c7d3..96cd77a528fb 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_security_connector_governance_rules_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_security_connector_governance_rules_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -19,10 +19,12 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models from ..._vendor import _convert_request @@ -63,14 +65,14 @@ def __init__(self, *args, **kwargs) -> None: async def get( self, resource_group_name: str, security_connector_name: str, rule_id: str, **kwargs: Any ) -> _models.GovernanceRule: - """Get a specific governanceRule for the requested scope by ruleId. + """Get a specific governance rule for the requested scope by ruleId. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. Required. :type resource_group_name: str :param security_connector_name: The security connector name. Required. :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -89,10 +91,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceRule] + ) + cls: ClsType[_models.GovernanceRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -105,9 +107,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -124,7 +126,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}" + } @overload async def create_or_update( @@ -137,17 +141,17 @@ async def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.GovernanceRule: - """Creates or update a security GovernanceRule on the given security connector. + """Creates or updates a governance rule on the given security connector. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. Required. :type resource_group_name: str :param security_connector_name: The security connector name. Required. :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param governance_rule: GovernanceRule over a subscription scope. Required. + :param governance_rule: Governance rule over a given scope. Required. :type governance_rule: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -169,17 +173,17 @@ async def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.GovernanceRule: - """Creates or update a security GovernanceRule on the given security connector. + """Creates or updates a governance rule on the given security connector. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. Required. :type resource_group_name: str :param security_connector_name: The security connector name. Required. :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param governance_rule: GovernanceRule over a subscription scope. Required. + :param governance_rule: Governance rule over a given scope. Required. :type governance_rule: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -199,18 +203,18 @@ async def create_or_update( governance_rule: Union[_models.GovernanceRule, IO], **kwargs: Any ) -> _models.GovernanceRule: - """Creates or update a security GovernanceRule on the given security connector. + """Creates or updates a governance rule on the given security connector. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. Required. :type resource_group_name: str :param security_connector_name: The security connector name. Required. :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param governance_rule: GovernanceRule over a subscription scope. Is either a model type or a - IO type. Required. + :param governance_rule: Governance rule over a given scope. Is either a model type or a IO + type. Required. :type governance_rule: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -231,11 +235,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceRule] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GovernanceRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -259,9 +263,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -278,31 +282,17 @@ async def create_or_update( deserialized = self._deserialize("GovernanceRule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}" + } - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, security_connector_name: str, rule_id: str, **kwargs: Any ) -> None: - """Delete a GovernanceRule over a given scope. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. Required. - :type resource_group_name: str - :param security_connector_name: The security connector name. Required. - :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. - Required. - :type rule_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -314,10 +304,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -325,24 +315,104 @@ async def delete( # pylint: disable=inconsistent-return-statements rule_id=rule_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata["url"], + template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}" + } - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}"} # type: ignore + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, security_connector_name: str, rule_id: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a Governance rule over a given scope. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. Required. + :type resource_group_name: str + :param security_connector_name: The security connector name. Required. + :type security_connector_name: str + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + security_connector_name=security_connector_name, + rule_id=rule_id, + 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): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + 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_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_subscription_governance_rules_execute_status_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_subscription_governance_rules_execute_status_operations.py deleted file mode 100644 index 792b2aacd816..000000000000 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_subscription_governance_rules_execute_status_operations.py +++ /dev/null @@ -1,184 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._subscription_governance_rules_execute_status_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]] - - -class SubscriptionGovernanceRulesExecuteStatusOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.security.v2022_01_01_preview.aio.SecurityCenter`'s - :attr:`subscription_governance_rules_execute_status` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - 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") - - async def _get_initial(self, rule_id: str, operation_id: str, **kwargs: Any) -> Optional[_models.ExecuteRuleStatus]: - 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 = kwargs.pop( - "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ExecuteRuleStatus]] - - request = build_get_request( - rule_id=rule_id, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._get_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore - - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **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("ExecuteRuleStatus", 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 - - _get_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}"} # type: ignore - - @distributed_trace_async - async def begin_get( - self, rule_id: str, operation_id: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ExecuteRuleStatus]: - """Get a specific governanceRule execution status for the requested scope by ruleId and - operationId. - - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. - Required. - :type rule_id: str - :param operation_id: The security GovernanceRule execution key - unique key for the execution - of GovernanceRule. Required. - :type operation_id: 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 ExecuteRuleStatus or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.security.v2022_01_01_preview.models.ExecuteRuleStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExecuteRuleStatus] - polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = await self._get_initial( # type: ignore - rule_id=rule_id, - operation_id=operation_id, - 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("ExecuteRuleStatus", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod - 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) - - begin_get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}"} # type: ignore diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_subscription_governance_rules_operation_result_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_subscription_governance_rules_operation_result_operations.py new file mode 100644 index 000000000000..761d083d1d5b --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/aio/operations/_subscription_governance_rules_operation_result_operations.py @@ -0,0 +1,129 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._subscription_governance_rules_operation_result_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]] + + +class SubscriptionGovernanceRulesOperationResultOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.security.v2022_01_01_preview.aio.SecurityCenter`'s + :attr:`subscription_governance_rules_operation_result` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + 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_async + async def get( + self, rule_id: str, operation_id: str, **kwargs: Any + ) -> Optional[_models.OperationResultAutoGenerated]: + """Get governance rules long run operation result for the requested scope by ruleId and + operationId. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param operation_id: The governance rule execution key - unique key for the execution of + governance rule. Required. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationResultAutoGenerated or None or the result of cls(response) + :rtype: ~azure.mgmt.security.v2022_01_01_preview.models.OperationResultAutoGenerated or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + cls: ClsType[Optional[_models.OperationResultAutoGenerated]] = kwargs.pop("cls", None) + + request = build_get_request( + rule_id=rule_id, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **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("OperationResultAutoGenerated", 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 + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/models/__init__.py index 33ca71a193ab..7cecb4ad458c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/models/__init__.py @@ -10,7 +10,6 @@ from ._models_py3 import Condition from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ExecuteGovernanceRuleParams -from ._models_py3 import ExecuteRuleStatus from ._models_py3 import GovernanceAssignment from ._models_py3 import GovernanceAssignmentAdditionalData from ._models_py3 import GovernanceAssignmentsList @@ -18,7 +17,9 @@ from ._models_py3 import GovernanceRule from ._models_py3 import GovernanceRuleEmailNotification from ._models_py3 import GovernanceRuleList +from ._models_py3 import GovernanceRuleMetadata from ._models_py3 import GovernanceRuleOwnerSource +from ._models_py3 import OperationResultAutoGenerated from ._models_py3 import RemediationEta from ._models_py3 import Resource @@ -26,8 +27,9 @@ from ._security_center_enums import GovernanceRuleOwnerSourceType from ._security_center_enums import GovernanceRuleSourceResourceType from ._security_center_enums import GovernanceRuleType +from ._security_center_enums import OperationResult from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -35,7 +37,6 @@ "Condition", "ErrorAdditionalInfo", "ExecuteGovernanceRuleParams", - "ExecuteRuleStatus", "GovernanceAssignment", "GovernanceAssignmentAdditionalData", "GovernanceAssignmentsList", @@ -43,13 +44,16 @@ "GovernanceRule", "GovernanceRuleEmailNotification", "GovernanceRuleList", + "GovernanceRuleMetadata", "GovernanceRuleOwnerSource", + "OperationResultAutoGenerated", "RemediationEta", "Resource", "GovernanceRuleConditionOperator", "GovernanceRuleOwnerSourceType", "GovernanceRuleSourceResourceType", "GovernanceRuleType", + "OperationResult", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/models/_models_py3.py index 576f80d26382..bc1c5d5e9979 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/models/_models_py3.py @@ -163,29 +163,6 @@ def __init__(self, *, override: Optional[bool] = None, **kwargs): self.override = override -class ExecuteRuleStatus(_serialization.Model): - """Execute status of Security GovernanceRule over a given scope. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar operation_id: Unique key for the execution of GovernanceRule. - :vartype operation_id: str - """ - - _validation = { - "operation_id": {"readonly": True}, - } - - _attribute_map = { - "operation_id": {"key": "operationId", "type": "str"}, - } - - def __init__(self, **kwargs): - """ """ - super().__init__(**kwargs) - self.operation_id = None - - class Resource(_serialization.Model): """Describes an Azure resource. @@ -220,7 +197,7 @@ def __init__(self, **kwargs): class GovernanceAssignment(Resource): - """Security GovernanceAssignment over a given scope. + """Governance assignment over a given scope. Variables are only populated by the server, and will be ignored when sending a request. @@ -312,15 +289,15 @@ def __init__( class GovernanceAssignmentAdditionalData(_serialization.Model): - """Describe the additional data of GovernanceAssignment - optional. + """Describe the additional data of governance assignment - optional. - :ivar ticket_number: Ticket number associated with this GovernanceAssignment. + :ivar ticket_number: Ticket number associated with this governance assignment. :vartype ticket_number: int - :ivar ticket_link: Ticket link associated with this GovernanceAssignment - for example: + :ivar ticket_link: Ticket link associated with this governance assignment - for example: https://snow.com. :vartype ticket_link: str - :ivar ticket_status: The ticket status associated with this GovernanceAssignment - for example: - Active. + :ivar ticket_status: The ticket status associated with this governance assignment - for + example: Active. :vartype ticket_status: str """ @@ -343,12 +320,12 @@ def __init__( **kwargs ): """ - :keyword ticket_number: Ticket number associated with this GovernanceAssignment. + :keyword ticket_number: Ticket number associated with this governance assignment. :paramtype ticket_number: int - :keyword ticket_link: Ticket link associated with this GovernanceAssignment - for example: + :keyword ticket_link: Ticket link associated with this governance assignment - for example: https://snow.com. :paramtype ticket_link: str - :keyword ticket_status: The ticket status associated with this GovernanceAssignment - for + :keyword ticket_status: The ticket status associated with this governance assignment - for example: Active. :paramtype ticket_status: str """ @@ -359,7 +336,7 @@ def __init__( class GovernanceAssignmentsList(_serialization.Model): - """Page of a security governance assignments list. + """Page of a governance assignments list. Variables are only populated by the server, and will be ignored when sending a request. @@ -419,7 +396,7 @@ def __init__( class GovernanceRule(Resource): # pylint: disable=too-many-instance-attributes - """Security GovernanceRule over a given scope. + """Governance rule over a given scope. Variables are only populated by the server, and will be ignored when sending a request. @@ -429,9 +406,11 @@ class GovernanceRule(Resource): # pylint: disable=too-many-instance-attributes :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar display_name: display name of the governanceRule. + :ivar tenant_id: The tenantId (GUID). + :vartype tenant_id: str + :ivar display_name: Display name of the governance rule. :vartype display_name: str - :ivar description: description of the governanceRule. + :ivar description: Description of the governance rule. :vartype description: str :ivar remediation_timeframe: Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. 7.00:00:00 - means 7 days. @@ -450,9 +429,15 @@ class GovernanceRule(Resource): # pylint: disable=too-many-instance-attributes Assessments. "Assessments" :vartype source_resource_type: str or ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRuleSourceResourceType + :ivar excluded_scopes: Excluded scopes, filter out the descendants of the scope (on management + scopes). + :vartype excluded_scopes: list[str] :ivar condition_sets: The governance rule conditionSets - see examples. :vartype condition_sets: list[JSON] - :ivar owner_source: The Owner source for the governance rule - e.g. Manually by + :ivar include_member_scopes: Defines whether the rule is management scope rule (master + connector as a single scope or management scope). + :vartype include_member_scopes: bool + :ivar owner_source: The owner source for the governance rule - e.g. Manually by user@contoso.com - see example. :vartype owner_source: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRuleOwnerSource @@ -460,12 +445,16 @@ class GovernanceRule(Resource): # pylint: disable=too-many-instance-attributes states whether to disable notifications for mangers and owners. :vartype governance_email_notification: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRuleEmailNotification + :ivar metadata: The governance rule metadata. + :vartype metadata: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRuleMetadata """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "tenant_id": {"readonly": True}, + "remediation_timeframe": {"pattern": r"^[0-9]+\.[0-9]{2}:[0-9]{2}:[0-9]{2}$"}, "rule_priority": {"maximum": 1000, "minimum": 0}, } @@ -473,6 +462,7 @@ class GovernanceRule(Resource): # pylint: disable=too-many-instance-attributes "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "tenant_id": {"key": "properties.tenantId", "type": "str"}, "display_name": {"key": "properties.displayName", "type": "str"}, "description": {"key": "properties.description", "type": "str"}, "remediation_timeframe": {"key": "properties.remediationTimeframe", "type": "str"}, @@ -481,12 +471,15 @@ class GovernanceRule(Resource): # pylint: disable=too-many-instance-attributes "is_disabled": {"key": "properties.isDisabled", "type": "bool"}, "rule_type": {"key": "properties.ruleType", "type": "str"}, "source_resource_type": {"key": "properties.sourceResourceType", "type": "str"}, + "excluded_scopes": {"key": "properties.excludedScopes", "type": "[str]"}, "condition_sets": {"key": "properties.conditionSets", "type": "[object]"}, + "include_member_scopes": {"key": "properties.includeMemberScopes", "type": "bool"}, "owner_source": {"key": "properties.ownerSource", "type": "GovernanceRuleOwnerSource"}, "governance_email_notification": { "key": "properties.governanceEmailNotification", "type": "GovernanceRuleEmailNotification", }, + "metadata": {"key": "properties.metadata", "type": "GovernanceRuleMetadata"}, } def __init__( @@ -500,15 +493,18 @@ def __init__( is_disabled: Optional[bool] = None, rule_type: Optional[Union[str, "_models.GovernanceRuleType"]] = None, source_resource_type: Optional[Union[str, "_models.GovernanceRuleSourceResourceType"]] = None, + excluded_scopes: Optional[List[str]] = None, condition_sets: Optional[List[JSON]] = None, + include_member_scopes: Optional[bool] = None, owner_source: Optional["_models.GovernanceRuleOwnerSource"] = None, governance_email_notification: Optional["_models.GovernanceRuleEmailNotification"] = None, + metadata: Optional["_models.GovernanceRuleMetadata"] = None, **kwargs ): """ - :keyword display_name: display name of the governanceRule. + :keyword display_name: Display name of the governance rule. :paramtype display_name: str - :keyword description: description of the governanceRule. + :keyword description: Description of the governance rule. :paramtype description: str :keyword remediation_timeframe: Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. 7.00:00:00 - means 7 days. @@ -527,9 +523,15 @@ def __init__( Assessments. "Assessments" :paramtype source_resource_type: str or ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRuleSourceResourceType + :keyword excluded_scopes: Excluded scopes, filter out the descendants of the scope (on + management scopes). + :paramtype excluded_scopes: list[str] :keyword condition_sets: The governance rule conditionSets - see examples. :paramtype condition_sets: list[JSON] - :keyword owner_source: The Owner source for the governance rule - e.g. Manually by + :keyword include_member_scopes: Defines whether the rule is management scope rule (master + connector as a single scope or management scope). + :paramtype include_member_scopes: bool + :keyword owner_source: The owner source for the governance rule - e.g. Manually by user@contoso.com - see example. :paramtype owner_source: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRuleOwnerSource @@ -537,8 +539,11 @@ def __init__( rule, states whether to disable notifications for mangers and owners. :paramtype governance_email_notification: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRuleEmailNotification + :keyword metadata: The governance rule metadata. + :paramtype metadata: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRuleMetadata """ super().__init__(**kwargs) + self.tenant_id = None self.display_name = display_name self.description = description self.remediation_timeframe = remediation_timeframe @@ -547,9 +552,12 @@ def __init__( self.is_disabled = is_disabled self.rule_type = rule_type self.source_resource_type = source_resource_type + self.excluded_scopes = excluded_scopes self.condition_sets = condition_sets + self.include_member_scopes = include_member_scopes self.owner_source = owner_source self.governance_email_notification = governance_email_notification + self.metadata = metadata class GovernanceRuleEmailNotification(_serialization.Model): @@ -588,11 +596,11 @@ def __init__( class GovernanceRuleList(_serialization.Model): - """Page of a security governanceRules list. + """Page of a governance rules list. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: Collection of governanceRules in this page. + :ivar value: Collection of governance rules in this page. :vartype value: list[~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule] :ivar next_link: The URI to fetch the next page. :vartype next_link: str @@ -615,6 +623,44 @@ def __init__(self, **kwargs): self.next_link = None +class GovernanceRuleMetadata(_serialization.Model): + """The governance rule metadata. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_by: Governance rule Created by object id (GUID). + :vartype created_by: str + :ivar created_on: Governance rule creation date. + :vartype created_on: ~datetime.datetime + :ivar updated_by: Governance rule last updated by object id (GUID). + :vartype updated_by: str + :ivar updated_on: Governance rule last update date. + :vartype updated_on: ~datetime.datetime + """ + + _validation = { + "created_by": {"readonly": True}, + "created_on": {"readonly": True}, + "updated_by": {"readonly": True}, + "updated_on": {"readonly": True}, + } + + _attribute_map = { + "created_by": {"key": "createdBy", "type": "str"}, + "created_on": {"key": "createdOn", "type": "iso-8601"}, + "updated_by": {"key": "updatedBy", "type": "str"}, + "updated_on": {"key": "updatedOn", "type": "iso-8601"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.created_by = None + self.created_on = None + self.updated_by = None + self.updated_on = None + + class GovernanceRuleOwnerSource(_serialization.Model): """Describe the owner source of governance rule. @@ -651,6 +697,30 @@ def __init__( self.value = value +class OperationResultAutoGenerated(_serialization.Model): + """Long run operation status of governance rule over a given scope. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The status of the long run operation result of governance rule. Known values are: + "Succeeded", "Failed", and "Canceled". + :vartype status: str or ~azure.mgmt.security.v2022_01_01_preview.models.OperationResult + """ + + _validation = { + "status": {"readonly": True}, + } + + _attribute_map = { + "status": {"key": "status", "type": "str"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.status = None + + class RemediationEta(_serialization.Model): """The ETA (estimated time of arrival) for remediation. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/models/_security_center_enums.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/models/_security_center_enums.py index 997e5a68c329..5ad7edf988d4 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/models/_security_center_enums.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/models/_security_center_enums.py @@ -45,3 +45,14 @@ class GovernanceRuleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): INTEGRATED = "Integrated" #: The source of the rule type definition is ServiceNow SERVICE_NOW = "ServiceNow" + + +class OperationResult(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status of the long run operation result of governance rule.""" + + #: The operation succeeded + SUCCEEDED = "Succeeded" + #: The operation failed + FAILED = "Failed" + #: The operation canceled + CANCELED = "Canceled" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/__init__.py index 504e37b2c881..79881e12e604 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/__init__.py @@ -10,14 +10,21 @@ from ._governance_rules_operations import GovernanceRulesOperations from ._security_connector_governance_rule_operations import SecurityConnectorGovernanceRuleOperations from ._security_connector_governance_rules_operations import SecurityConnectorGovernanceRulesOperations -from ._subscription_governance_rules_execute_status_operations import SubscriptionGovernanceRulesExecuteStatusOperations -from ._security_connector_governance_rules_execute_status_operations import ( - SecurityConnectorGovernanceRulesExecuteStatusOperations, +from ._management_group_governance_rule_operations import ManagementGroupGovernanceRuleOperations +from ._management_group_governance_rules_operations import ManagementGroupGovernanceRulesOperations +from ._subscription_governance_rules_operation_result_operations import ( + SubscriptionGovernanceRulesOperationResultOperations, +) +from ._security_connector_governance_rules_operation_result_operations import ( + SecurityConnectorGovernanceRulesOperationResultOperations, +) +from ._management_group_governance_rules_operation_result_operations import ( + ManagementGroupGovernanceRulesOperationResultOperations, ) from ._governance_assignments_operations import GovernanceAssignmentsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ @@ -25,8 +32,11 @@ "GovernanceRulesOperations", "SecurityConnectorGovernanceRuleOperations", "SecurityConnectorGovernanceRulesOperations", - "SubscriptionGovernanceRulesExecuteStatusOperations", - "SecurityConnectorGovernanceRulesExecuteStatusOperations", + "ManagementGroupGovernanceRuleOperations", + "ManagementGroupGovernanceRulesOperations", + "SubscriptionGovernanceRulesOperationResultOperations", + "SecurityConnectorGovernanceRulesOperationResultOperations", + "ManagementGroupGovernanceRulesOperationResultOperations", "GovernanceAssignmentsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_governance_assignments_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_governance_assignments_operations.py index b5e0bcae48b5..17e0c37a34b4 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_governance_assignments_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_governance_assignments_operations.py @@ -45,9 +45,9 @@ def build_list_request(scope: str, assessment_name: str, **kwargs: Any) -> HttpR _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,10 +56,10 @@ def build_list_request(scope: str, assessment_name: str, **kwargs: Any) -> HttpR ) # pylint: disable=line-too-long path_format_arguments = { "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), - "assessmentName": _SERIALIZER.url("assessment_name", assessment_name, "str"), + "assessmentName": _SERIALIZER.url("assessment_name", assessment_name, "str", pattern=r"^[-\w\._\(\)]+$"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -74,9 +74,9 @@ def build_get_request(scope: str, assessment_name: str, assignment_key: str, **k _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,11 +86,11 @@ def build_get_request(scope: str, assessment_name: str, assignment_key: str, **k ) # pylint: disable=line-too-long path_format_arguments = { "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), - "assessmentName": _SERIALIZER.url("assessment_name", assessment_name, "str"), + "assessmentName": _SERIALIZER.url("assessment_name", assessment_name, "str", pattern=r"^[-\w\._\(\)]+$"), "assignmentKey": _SERIALIZER.url("assignment_key", assignment_key, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -105,10 +105,10 @@ def build_create_or_update_request(scope: str, assessment_name: str, assignment_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,11 +118,11 @@ def build_create_or_update_request(scope: str, assessment_name: str, assignment_ ) # pylint: disable=line-too-long path_format_arguments = { "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), - "assessmentName": _SERIALIZER.url("assessment_name", assessment_name, "str"), + "assessmentName": _SERIALIZER.url("assessment_name", assessment_name, "str", pattern=r"^[-\w\._\(\)]+$"), "assignmentKey": _SERIALIZER.url("assignment_key", assignment_key, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -138,9 +138,9 @@ def build_create_or_update_request(scope: str, assessment_name: str, assignment_ def build_delete_request(scope: str, assessment_name: str, assignment_key: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -148,11 +148,11 @@ def build_delete_request(scope: str, assessment_name: str, assignment_key: str, ) # pylint: disable=line-too-long path_format_arguments = { "scope": _SERIALIZER.url("scope", scope, "str", skip_quote=True), - "assessmentName": _SERIALIZER.url("assessment_name", assessment_name, "str"), + "assessmentName": _SERIALIZER.url("assessment_name", assessment_name, "str", pattern=r"^[-\w\._\(\)]+$"), "assignmentKey": _SERIALIZER.url("assignment_key", assignment_key, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -181,13 +181,13 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, scope: str, assessment_name: str, **kwargs: Any) -> Iterable["_models.GovernanceAssignment"]: - """Get security governanceAssignments on all your resources inside a scope. + """Get governance assignments on all of your resources inside a scope. :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). Required. :type scope: str - :param assessment_name: The Assessment Key - Unique key for the assessment type. Required. + :param assessment_name: The Assessment Key - A unique key for the assessment type. Required. :type assessment_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GovernanceAssignment or the result of @@ -199,10 +199,10 @@ def list(self, scope: str, assessment_name: str, **kwargs: Any) -> Iterable["_mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceAssignmentsList] + ) + cls: ClsType[_models.GovernanceAssignmentsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -224,7 +224,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -240,7 +240,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -248,13 +248,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("GovernanceAssignmentsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -267,7 +267,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments"} # type: ignore + list.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments"} @distributed_trace def get(self, scope: str, assessment_name: str, assignment_key: str, **kwargs: Any) -> _models.GovernanceAssignment: @@ -277,10 +277,10 @@ def get(self, scope: str, assessment_name: str, assignment_key: str, **kwargs: A (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). Required. :type scope: str - :param assessment_name: The Assessment Key - Unique key for the assessment type. Required. + :param assessment_name: The Assessment Key - A unique key for the assessment type. Required. :type assessment_name: str - :param assignment_key: The security governance assignment key - the assessment key of the - required governance assignment. Required. + :param assignment_key: The governance assignment key - the assessment key of the required + governance assignment. Required. :type assignment_key: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GovernanceAssignment or the result of cls(response) @@ -298,10 +298,10 @@ def get(self, scope: str, assessment_name: str, assignment_key: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceAssignment] + ) + cls: ClsType[_models.GovernanceAssignment] = kwargs.pop("cls", None) request = build_get_request( scope=scope, @@ -313,9 +313,9 @@ def get(self, scope: str, assessment_name: str, assignment_key: str, **kwargs: A params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -332,7 +332,9 @@ def get(self, scope: str, assessment_name: str, assignment_key: str, **kwargs: A return deserialized - get.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}"} # type: ignore + get.metadata = { + "url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}" + } @overload def create_or_update( @@ -345,18 +347,18 @@ def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.GovernanceAssignment: - """Creates or update a security GovernanceAssignment on the given subscription. + """Creates or updates a governance assignment on the given subscription. :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). Required. :type scope: str - :param assessment_name: The Assessment Key - Unique key for the assessment type. Required. + :param assessment_name: The Assessment Key - A unique key for the assessment type. Required. :type assessment_name: str - :param assignment_key: The security governance assignment key - the assessment key of the - required governance assignment. Required. + :param assignment_key: The governance assignment key - the assessment key of the required + governance assignment. Required. :type assignment_key: str - :param governance_assignment: GovernanceAssignment over a subscription scope. Required. + :param governance_assignment: Governance assignment over a subscription scope. Required. :type governance_assignment: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceAssignment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -379,18 +381,18 @@ def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.GovernanceAssignment: - """Creates or update a security GovernanceAssignment on the given subscription. + """Creates or updates a governance assignment on the given subscription. :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). Required. :type scope: str - :param assessment_name: The Assessment Key - Unique key for the assessment type. Required. + :param assessment_name: The Assessment Key - A unique key for the assessment type. Required. :type assessment_name: str - :param assignment_key: The security governance assignment key - the assessment key of the - required governance assignment. Required. + :param assignment_key: The governance assignment key - the assessment key of the required + governance assignment. Required. :type assignment_key: str - :param governance_assignment: GovernanceAssignment over a subscription scope. Required. + :param governance_assignment: Governance assignment over a subscription scope. Required. :type governance_assignment: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -410,19 +412,19 @@ def create_or_update( governance_assignment: Union[_models.GovernanceAssignment, IO], **kwargs: Any ) -> _models.GovernanceAssignment: - """Creates or update a security GovernanceAssignment on the given subscription. + """Creates or updates a governance assignment on the given subscription. :param scope: Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). Required. :type scope: str - :param assessment_name: The Assessment Key - Unique key for the assessment type. Required. + :param assessment_name: The Assessment Key - A unique key for the assessment type. Required. :type assessment_name: str - :param assignment_key: The security governance assignment key - the assessment key of the - required governance assignment. Required. + :param assignment_key: The governance assignment key - the assessment key of the required + governance assignment. Required. :type assignment_key: str - :param governance_assignment: GovernanceAssignment over a subscription scope. Is either a model - type or a IO type. Required. + :param governance_assignment: Governance assignment over a subscription scope. Is either a + model type or a IO type. Required. :type governance_assignment: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceAssignment or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -444,11 +446,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceAssignment] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GovernanceAssignment] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -471,9 +473,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -490,11 +492,13 @@ def create_or_update( deserialized = self._deserialize("GovernanceAssignment", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}"} # type: ignore + create_or_update.metadata = { + "url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -506,10 +510,10 @@ def delete( # pylint: disable=inconsistent-return-statements (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). Required. :type scope: str - :param assessment_name: The Assessment Key - Unique key for the assessment type. Required. + :param assessment_name: The Assessment Key - A unique key for the assessment type. Required. :type assessment_name: str - :param assignment_key: The security governance assignment key - the assessment key of the - required governance assignment. Required. + :param assignment_key: The governance assignment key - the assessment key of the required + governance assignment. Required. :type assignment_key: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) @@ -527,10 +531,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( scope=scope, @@ -542,9 +546,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -557,4 +561,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}"} # type: ignore + delete.metadata = { + "url": "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_governance_rule_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_governance_rule_operations.py index 79400be6e24d..a00875f87ad5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_governance_rule_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_governance_rule_operations.py @@ -45,9 +45,9 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -90,7 +90,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list(self, **kwargs: Any) -> Iterable["_models.GovernanceRule"]: - """Get a list of all relevant governanceRules over a subscription level scope. + """Get a list of the governance rules on the subscription level scope. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GovernanceRule or the result of cls(response) @@ -101,10 +101,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.GovernanceRule"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceRuleList] + ) + cls: ClsType[_models.GovernanceRuleList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -125,7 +125,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -141,7 +141,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -149,13 +149,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("GovernanceRuleList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -168,4 +168,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_governance_rules_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_governance_rules_operations.py index 3871d0f36948..55e03135dfc1 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_governance_rules_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_governance_rules_operations.py @@ -45,9 +45,9 @@ def build_get_request(rule_id: str, subscription_id: str, **kwargs: Any) -> Http _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_get_request(rule_id: str, subscription_id: str, **kwargs: Any) -> Http "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -76,10 +76,10 @@ def build_create_or_update_request(rule_id: str, subscription_id: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,7 +93,7 @@ def build_create_or_update_request(rule_id: str, subscription_id: str, **kwargs: "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -109,9 +109,9 @@ def build_create_or_update_request(rule_id: str, subscription_id: str, **kwargs: def build_delete_request(rule_id: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}" @@ -123,7 +123,7 @@ def build_delete_request(rule_id: str, subscription_id: str, **kwargs: Any) -> H "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -135,10 +135,10 @@ def build_rule_id_execute_single_subscription_request(rule_id: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +152,7 @@ def build_rule_id_execute_single_subscription_request(rule_id: str, subscription "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -171,10 +171,10 @@ def build_rule_id_execute_single_security_connector_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -189,11 +189,48 @@ def build_rule_id_execute_single_security_connector_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), + "securityConnectorName": _SERIALIZER.url( + "security_connector_name", security_connector_name, "str", pattern=r"^[-\w\._\(\)]+$" + ), + "ruleId": _SERIALIZER.url("rule_id", rule_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_rule_id_execute_single_management_group_request( + rule_id: str, management_group_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-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute", + ) # pylint: disable=line-too-long + path_format_arguments = { + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -227,9 +264,9 @@ def __init__(self, *args, **kwargs): @distributed_trace def get(self, rule_id: str, **kwargs: Any) -> _models.GovernanceRule: - """Get a specific governanceRule for the requested scope by ruleId. + """Get a specific governance rule for the requested scope by ruleId. - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -248,10 +285,10 @@ def get(self, rule_id: str, **kwargs: Any) -> _models.GovernanceRule: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceRule] + ) + cls: ClsType[_models.GovernanceRule] = kwargs.pop("cls", None) request = build_get_request( rule_id=rule_id, @@ -262,9 +299,9 @@ def get(self, rule_id: str, **kwargs: Any) -> _models.GovernanceRule: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -281,7 +318,7 @@ def get(self, rule_id: str, **kwargs: Any) -> _models.GovernanceRule: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}"} @overload def create_or_update( @@ -292,12 +329,12 @@ def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.GovernanceRule: - """Creates or update a security GovernanceRule on the given subscription. + """Creates or updates a governance rule on a subscription. - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param governance_rule: GovernanceRule over a subscription scope. Required. + :param governance_rule: Governance rule over a given scope. Required. :type governance_rule: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -312,12 +349,12 @@ def create_or_update( def create_or_update( self, rule_id: str, governance_rule: IO, *, content_type: str = "application/json", **kwargs: Any ) -> _models.GovernanceRule: - """Creates or update a security GovernanceRule on the given subscription. + """Creates or updates a governance rule on a subscription. - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param governance_rule: GovernanceRule over a subscription scope. Required. + :param governance_rule: Governance rule over a given scope. Required. :type governance_rule: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -332,13 +369,13 @@ def create_or_update( def create_or_update( self, rule_id: str, governance_rule: Union[_models.GovernanceRule, IO], **kwargs: Any ) -> _models.GovernanceRule: - """Creates or update a security GovernanceRule on the given subscription. + """Creates or updates a governance rule on a subscription. - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param governance_rule: GovernanceRule over a subscription scope. Is either a model type or a - IO type. Required. + :param governance_rule: Governance rule over a given scope. Is either a model type or a IO + type. Required. :type governance_rule: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -359,11 +396,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceRule] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GovernanceRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -385,9 +422,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -404,17 +441,19 @@ def create_or_update( deserialized = self._deserialize("GovernanceRule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}" + } @distributed_trace def delete(self, rule_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Delete a GovernanceRule over a given scope. + """Delete a Governance rule over a given scope. - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -433,10 +472,10 @@ def delete(self, rule_id: str, **kwargs: Any) -> None: # pylint: disable=incons _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( rule_id=rule_id, @@ -447,9 +486,9 @@ def delete(self, rule_id: str, **kwargs: Any) -> None: # pylint: disable=incons params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -462,7 +501,7 @@ def delete(self, rule_id: str, **kwargs: Any) -> None: # pylint: disable=incons if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}"} # type: ignore + delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}"} def _rule_id_execute_single_subscription_initial( # pylint: disable=inconsistent-return-statements self, @@ -481,11 +520,11 @@ def _rule_id_execute_single_subscription_initial( # pylint: disable=inconsisten _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -510,9 +549,9 @@ def _rule_id_execute_single_subscription_initial( # pylint: disable=inconsisten params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -528,7 +567,9 @@ def _rule_id_execute_single_subscription_initial( # pylint: disable=inconsisten if cls: return cls(pipeline_response, None, response_headers) - _rule_id_execute_single_subscription_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute"} # type: ignore + _rule_id_execute_single_subscription_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" + } @overload def begin_rule_id_execute_single_subscription( @@ -539,13 +580,13 @@ def begin_rule_id_execute_single_subscription( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: - """Execute a security GovernanceRule on the given subscription. + """Execute a governance rule on a subscription. - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param execute_governance_rule_params: GovernanceRule over a subscription scope. Default value - is None. + :param execute_governance_rule_params: Execute governance rule over a given scope. Default + value is None. :type execute_governance_rule_params: ~azure.mgmt.security.v2022_01_01_preview.models.ExecuteGovernanceRuleParams :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -573,13 +614,13 @@ def begin_rule_id_execute_single_subscription( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: - """Execute a security GovernanceRule on the given subscription. + """Execute a governance rule on a subscription. - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param execute_governance_rule_params: GovernanceRule over a subscription scope. Default value - is None. + :param execute_governance_rule_params: Execute governance rule over a given scope. Default + value is None. :type execute_governance_rule_params: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -604,12 +645,12 @@ def begin_rule_id_execute_single_subscription( execute_governance_rule_params: Optional[Union[_models.ExecuteGovernanceRuleParams, IO]] = None, **kwargs: Any ) -> LROPoller[None]: - """Execute a security GovernanceRule on the given subscription. + """Execute a governance rule on a subscription. - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param execute_governance_rule_params: GovernanceRule over a subscription scope. Is either a + :param execute_governance_rule_params: Execute governance rule over a given scope. Is either a model type or a IO type. Default value is None. :type execute_governance_rule_params: ~azure.mgmt.security.v2022_01_01_preview.models.ExecuteGovernanceRuleParams or IO @@ -631,14 +672,14 @@ def begin_rule_id_execute_single_subscription( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._rule_id_execute_single_subscription_initial( # type: ignore rule_id=rule_id, @@ -657,7 +698,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -669,9 +712,11 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - begin_rule_id_execute_single_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute"} # type: ignore + begin_rule_id_execute_single_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" + } def _rule_id_execute_single_security_connector_initial( # pylint: disable=inconsistent-return-statements self, @@ -692,11 +737,11 @@ def _rule_id_execute_single_security_connector_initial( # pylint: disable=incon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -723,9 +768,9 @@ def _rule_id_execute_single_security_connector_initial( # pylint: disable=incon params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -741,7 +786,9 @@ def _rule_id_execute_single_security_connector_initial( # pylint: disable=incon if cls: return cls(pipeline_response, None, response_headers) - _rule_id_execute_single_security_connector_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/execute"} # type: ignore + _rule_id_execute_single_security_connector_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" + } @overload def begin_rule_id_execute_single_security_connector( @@ -754,18 +801,18 @@ def begin_rule_id_execute_single_security_connector( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: - """Execute a security GovernanceRule on the given security connector. + """Execute a governance rule on the given security connector. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. Required. :type resource_group_name: str :param security_connector_name: The security connector name. Required. :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param execute_governance_rule_params: GovernanceRule over a subscription scope. Default value - is None. + :param execute_governance_rule_params: Execute governance rule over a given scope. Default + value is None. :type execute_governance_rule_params: ~azure.mgmt.security.v2022_01_01_preview.models.ExecuteGovernanceRuleParams :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -795,18 +842,18 @@ def begin_rule_id_execute_single_security_connector( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: - """Execute a security GovernanceRule on the given security connector. + """Execute a governance rule on the given security connector. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. Required. :type resource_group_name: str :param security_connector_name: The security connector name. Required. :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param execute_governance_rule_params: GovernanceRule over a subscription scope. Default value - is None. + :param execute_governance_rule_params: Execute governance rule over a given scope. Default + value is None. :type execute_governance_rule_params: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -833,17 +880,17 @@ def begin_rule_id_execute_single_security_connector( execute_governance_rule_params: Optional[Union[_models.ExecuteGovernanceRuleParams, IO]] = None, **kwargs: Any ) -> LROPoller[None]: - """Execute a security GovernanceRule on the given security connector. + """Execute a governance rule on the given security connector. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. Required. :type resource_group_name: str :param security_connector_name: The security connector name. Required. :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param execute_governance_rule_params: GovernanceRule over a subscription scope. Is either a + :param execute_governance_rule_params: Execute governance rule over a given scope. Is either a model type or a IO type. Default value is None. :type execute_governance_rule_params: ~azure.mgmt.security.v2022_01_01_preview.models.ExecuteGovernanceRuleParams or IO @@ -865,14 +912,14 @@ def begin_rule_id_execute_single_security_connector( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[None] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = self._rule_id_execute_single_security_connector_initial( # type: ignore resource_group_name=resource_group_name, @@ -893,7 +940,9 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return cls(pipeline_response, None, {}) if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: @@ -905,6 +954,223 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_rule_id_execute_single_security_connector.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" + } + + def _rule_id_execute_single_management_group_initial( # pylint: disable=inconsistent-return-statements + self, + rule_id: str, + execute_governance_rule_params: Optional[Union[_models.ExecuteGovernanceRuleParams, IO]] = None, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-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(execute_governance_rule_params, (IO, bytes)): + _content = execute_governance_rule_params + else: + if execute_governance_rule_params is not None: + _json = self._serialize.body(execute_governance_rule_params, "ExecuteGovernanceRuleParams") + else: + _json = None + + request = build_rule_id_execute_single_management_group_request( + rule_id=rule_id, + management_group_id=self._config.management_group_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._rule_id_execute_single_management_group_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + _rule_id_execute_single_management_group_initial.metadata = { + "url": "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" + } + + @overload + def begin_rule_id_execute_single_management_group( + self, + rule_id: str, + execute_governance_rule_params: Optional[_models.ExecuteGovernanceRuleParams] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Execute governance rule on the given management group. - begin_rule_id_execute_single_security_connector.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/execute"} # type: ignore + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param execute_governance_rule_params: Execute governance rule over a given scope. Default + value is None. + :type execute_governance_rule_params: + ~azure.mgmt.security.v2022_01_01_preview.models.ExecuteGovernanceRuleParams + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_rule_id_execute_single_management_group( + self, + rule_id: str, + execute_governance_rule_params: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Execute governance rule on the given management group. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param execute_governance_rule_params: Execute governance rule over a given scope. Default + value is None. + :type execute_governance_rule_params: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_rule_id_execute_single_management_group( + self, + rule_id: str, + execute_governance_rule_params: Optional[Union[_models.ExecuteGovernanceRuleParams, IO]] = None, + **kwargs: Any + ) -> LROPoller[None]: + """Execute governance rule on the given management group. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param execute_governance_rule_params: Execute governance rule over a given scope. Is either a + model type or a IO type. Default value is None. + :type execute_governance_rule_params: + ~azure.mgmt.security.v2022_01_01_preview.models.ExecuteGovernanceRuleParams or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-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) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._rule_id_execute_single_management_group_initial( # type: ignore + rule_id=rule_id, + execute_governance_rule_params=execute_governance_rule_params, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + 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_rule_id_execute_single_management_group.metadata = { + "url": "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_management_group_governance_rule_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_management_group_governance_rule_operations.py new file mode 100644 index 000000000000..d8e97a27f6e1 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_management_group_governance_rule_operations.py @@ -0,0 +1,174 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._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]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_list_request(management_group_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-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules", + ) # pylint: disable=line-too-long + path_format_arguments = { + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_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) + + +class ManagementGroupGovernanceRuleOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.security.v2022_01_01_preview.SecurityCenter`'s + :attr:`management_group_governance_rule` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + 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(self, **kwargs: Any) -> Iterable["_models.GovernanceRule"]: + """Get a list of all relevant governance rules over a management group level scope. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GovernanceRule or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + cls: ClsType[_models.GovernanceRuleList] = 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_request( + management_group_id=self._config.management_group_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + 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("GovernanceRuleList", 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) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = 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.metadata = { + "url": "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_management_group_governance_rules_operation_result_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_management_group_governance_rules_operation_result_operations.py new file mode 100644 index 000000000000..7de40f9f8b31 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_management_group_governance_rules_operation_result_operations.py @@ -0,0 +1,161 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._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]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request(rule_id: str, operation_id: str, management_group_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-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), + "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), + "operationId": _SERIALIZER.url("operation_id", operation_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) + + +class ManagementGroupGovernanceRulesOperationResultOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.security.v2022_01_01_preview.SecurityCenter`'s + :attr:`management_group_governance_rules_operation_result` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + 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 get(self, rule_id: str, operation_id: str, **kwargs: Any) -> Optional[_models.OperationResultAutoGenerated]: + """Get governance rules long run operation result for the requested scope by ruleId and + operationId. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param operation_id: The governance rule execution key - unique key for the execution of + governance rule. Required. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationResultAutoGenerated or None or the result of cls(response) + :rtype: ~azure.mgmt.security.v2022_01_01_preview.models.OperationResultAutoGenerated or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + cls: ClsType[Optional[_models.OperationResultAutoGenerated]] = kwargs.pop("cls", None) + + request = build_get_request( + rule_id=rule_id, + operation_id=operation_id, + management_group_id=self._config.management_group_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **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("OperationResultAutoGenerated", 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 + + get.metadata = { + "url": "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_management_group_governance_rules_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_management_group_governance_rules_operations.py new file mode 100644 index 000000000000..7235dc1b76c3 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_management_group_governance_rules_operations.py @@ -0,0 +1,451 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +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]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_get_request(rule_id: str, management_group_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-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), + "ruleId": _SERIALIZER.url("rule_id", rule_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_create_or_update_request(rule_id: str, management_group_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-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), + "ruleId": _SERIALIZER.url("rule_id", rule_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 + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request(rule_id: str, management_group_id: str, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + # Construct URL + _url = kwargs.pop( + "template_url", + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "managementGroupId": _SERIALIZER.url("management_group_id", management_group_id, "str"), + "ruleId": _SERIALIZER.url("rule_id", rule_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") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +class ManagementGroupGovernanceRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.security.v2022_01_01_preview.SecurityCenter`'s + :attr:`management_group_governance_rules` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + 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 get(self, rule_id: str, **kwargs: Any) -> _models.GovernanceRule: + """Get a specific governance rule for the requested scope by ruleId. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GovernanceRule or the result of cls(response) + :rtype: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + cls: ClsType[_models.GovernanceRule] = kwargs.pop("cls", None) + + request = build_get_request( + rule_id=rule_id, + management_group_id=self._config.management_group_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GovernanceRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}" + } + + @overload + def create_or_update( + self, + rule_id: str, + governance_rule: _models.GovernanceRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GovernanceRule: + """Creates or updates governance rule on the given management group. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param governance_rule: Governance rule over a given scope. Required. + :type governance_rule: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GovernanceRule or the result of cls(response) + :rtype: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, rule_id: str, governance_rule: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.GovernanceRule: + """Creates or updates governance rule on the given management group. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param governance_rule: Governance rule over a given scope. Required. + :type governance_rule: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GovernanceRule or the result of cls(response) + :rtype: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, rule_id: str, governance_rule: Union[_models.GovernanceRule, IO], **kwargs: Any + ) -> _models.GovernanceRule: + """Creates or updates governance rule on the given management group. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param governance_rule: Governance rule over a given scope. Is either a model type or a IO + type. Required. + :type governance_rule: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GovernanceRule or the result of cls(response) + :rtype: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GovernanceRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(governance_rule, (IO, bytes)): + _content = governance_rule + else: + _json = self._serialize.body(governance_rule, "GovernanceRule") + + request = build_create_or_update_request( + rule_id=rule_id, + management_group_id=self._config.management_group_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.create_or_update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("GovernanceRule", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("GovernanceRule", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + create_or_update.metadata = { + "url": "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}" + } + + def _delete_initial(self, rule_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + 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: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + rule_id=rule_id, + management_group_id=self._config.management_group_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = { + "url": "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}" + } + + @distributed_trace + def begin_delete(self, rule_id: str, **kwargs: Any) -> LROPoller[None]: + """Delete a Governance rule over a given scope. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + rule_id=rule_id, + 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): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + 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_delete.metadata = { + "url": "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Security/governanceRules/{ruleId}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_security_connector_governance_rule_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_security_connector_governance_rule_operations.py index 3c1dbacd1a65..52b8a91029eb 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_security_connector_governance_rule_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_security_connector_governance_rule_operations.py @@ -47,9 +47,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,10 +64,12 @@ def build_list_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), + "securityConnectorName": _SERIALIZER.url( + "security_connector_name", security_connector_name, "str", pattern=r"^[-\w\._\(\)]+$" + ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -101,7 +103,7 @@ def __init__(self, *args, **kwargs): def list( self, resource_group_name: str, security_connector_name: str, **kwargs: Any ) -> Iterable["_models.GovernanceRule"]: - """Get a list of all relevant governanceRules over a security connector level scope. + """Get a list of all relevant governance rules over a security connector level scope. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. Required. @@ -117,10 +119,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceRuleList] + ) + cls: ClsType[_models.GovernanceRuleList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -143,7 +145,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -159,7 +161,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -167,13 +169,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("GovernanceRuleList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -186,4 +188,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_security_connector_governance_rules_execute_status_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_security_connector_governance_rules_operation_result_operations.py similarity index 54% rename from sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_security_connector_governance_rules_execute_status_operations.py rename to sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_security_connector_governance_rules_operation_result_operations.py index 506e10ad39a4..63175608984d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_security_connector_governance_rules_execute_status_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_security_connector_governance_rules_operation_result_operations.py @@ -7,7 +7,7 @@ # 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 typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -19,12 +19,10 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models from ..._serialization import Serializer @@ -52,9 +50,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,12 +67,14 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), + "securityConnectorName": _SERIALIZER.url( + "security_connector_name", security_connector_name, "str", pattern=r"^[-\w\._\(\)]+$" + ), "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,14 +85,14 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class SecurityConnectorGovernanceRulesExecuteStatusOperations: +class SecurityConnectorGovernanceRulesOperationResultOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.security.v2022_01_01_preview.SecurityCenter`'s - :attr:`security_connector_governance_rules_execute_status` attribute. + :attr:`security_connector_governance_rules_operation_result` attribute. """ models = _models @@ -104,9 +104,29 @@ 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") - def _get_initial( + @distributed_trace + def get( self, resource_group_name: str, security_connector_name: str, rule_id: str, operation_id: str, **kwargs: Any - ) -> Optional[_models.ExecuteRuleStatus]: + ) -> Optional[_models.OperationResultAutoGenerated]: + """Get governance rule long run operation result for the requested scope by ruleId and + operationId. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. Required. + :type resource_group_name: str + :param security_connector_name: The security connector name. Required. + :type security_connector_name: str + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param operation_id: The governance rule execution key - unique key for the execution of + governance rule. Required. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationResultAutoGenerated or None or the result of cls(response) + :rtype: ~azure.mgmt.security.v2022_01_01_preview.models.OperationResultAutoGenerated or None + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -118,10 +138,10 @@ def _get_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ExecuteRuleStatus]] + ) + cls: ClsType[Optional[_models.OperationResultAutoGenerated]] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -130,14 +150,14 @@ def _get_initial( operation_id=operation_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._get_initial.metadata["url"], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -150,7 +170,7 @@ def _get_initial( deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("ExecuteRuleStatus", pipeline_response) + deserialized = self._deserialize("OperationResultAutoGenerated", pipeline_response) if response.status_code == 202: response_headers["location"] = self._deserialize("str", response.headers.get("location")) @@ -160,83 +180,6 @@ def _get_initial( return deserialized - _get_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}"} # type: ignore - - @distributed_trace - def begin_get( - self, resource_group_name: str, security_connector_name: str, rule_id: str, operation_id: str, **kwargs: Any - ) -> LROPoller[_models.ExecuteRuleStatus]: - """Get a specific governanceRule execution status for the requested scope by ruleId and - operationId. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. Required. - :type resource_group_name: str - :param security_connector_name: The security connector name. Required. - :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. - Required. - :type rule_id: str - :param operation_id: The security GovernanceRule execution key - unique key for the execution - of GovernanceRule. Required. - :type operation_id: 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 ExecuteRuleStatus or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.security.v2022_01_01_preview.models.ExecuteRuleStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExecuteRuleStatus] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._get_initial( # type: ignore - resource_group_name=resource_group_name, - security_connector_name=security_connector_name, - rule_id=rule_id, - operation_id=operation_id, - 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("ExecuteRuleStatus", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - 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) - - begin_get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_security_connector_governance_rules_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_security_connector_governance_rules_operations.py index 2df8e4d1fa94..65f4b22d3110 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_security_connector_governance_rules_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_security_connector_governance_rules_operations.py @@ -7,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -19,10 +19,12 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models from ..._serialization import Serializer @@ -45,9 +47,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,11 +64,13 @@ def build_get_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), + "securityConnectorName": _SERIALIZER.url( + "security_connector_name", security_connector_name, "str", pattern=r"^[-\w\._\(\)]+$" + ), "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -83,10 +87,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,11 +105,13 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), + "securityConnectorName": _SERIALIZER.url( + "security_connector_name", security_connector_name, "str", pattern=r"^[-\w\._\(\)]+$" + ), "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -123,9 +129,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -138,11 +144,13 @@ def build_delete_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._\(\)]+$" ), - "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), + "securityConnectorName": _SERIALIZER.url( + "security_connector_name", security_connector_name, "str", pattern=r"^[-\w\._\(\)]+$" + ), "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -173,14 +181,14 @@ def __init__(self, *args, **kwargs): def get( self, resource_group_name: str, security_connector_name: str, rule_id: str, **kwargs: Any ) -> _models.GovernanceRule: - """Get a specific governanceRule for the requested scope by ruleId. + """Get a specific governance rule for the requested scope by ruleId. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. Required. :type resource_group_name: str :param security_connector_name: The security connector name. Required. :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -199,10 +207,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceRule] + ) + cls: ClsType[_models.GovernanceRule] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -215,9 +223,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -234,7 +242,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}" + } @overload def create_or_update( @@ -247,17 +257,17 @@ def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.GovernanceRule: - """Creates or update a security GovernanceRule on the given security connector. + """Creates or updates a governance rule on the given security connector. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. Required. :type resource_group_name: str :param security_connector_name: The security connector name. Required. :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param governance_rule: GovernanceRule over a subscription scope. Required. + :param governance_rule: Governance rule over a given scope. Required. :type governance_rule: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -279,17 +289,17 @@ def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.GovernanceRule: - """Creates or update a security GovernanceRule on the given security connector. + """Creates or updates a governance rule on the given security connector. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. Required. :type resource_group_name: str :param security_connector_name: The security connector name. Required. :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param governance_rule: GovernanceRule over a subscription scope. Required. + :param governance_rule: Governance rule over a given scope. Required. :type governance_rule: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -309,18 +319,18 @@ def create_or_update( governance_rule: Union[_models.GovernanceRule, IO], **kwargs: Any ) -> _models.GovernanceRule: - """Creates or update a security GovernanceRule on the given security connector. + """Creates or updates a governance rule on the given security connector. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. Required. :type resource_group_name: str :param security_connector_name: The security connector name. Required. :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). Required. :type rule_id: str - :param governance_rule: GovernanceRule over a subscription scope. Is either a model type or a - IO type. Required. + :param governance_rule: Governance rule over a given scope. Is either a model type or a IO + type. Required. :type governance_rule: ~azure.mgmt.security.v2022_01_01_preview.models.GovernanceRule or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -341,11 +351,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.GovernanceRule] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GovernanceRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -369,9 +379,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -388,31 +398,17 @@ def create_or_update( deserialized = self._deserialize("GovernanceRule", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}" + } - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, security_connector_name: str, rule_id: str, **kwargs: Any ) -> None: - """Delete a GovernanceRule over a given scope. - - :param resource_group_name: The name of the resource group within the user's subscription. The - name is case insensitive. Required. - :type resource_group_name: str - :param security_connector_name: The security connector name. Required. - :type security_connector_name: str - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. - Required. - :type rule_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -424,10 +420,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -435,24 +431,104 @@ def delete( # pylint: disable=inconsistent-return-statements rule_id=rule_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata["url"], + template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + if cls: - return cls(pipeline_response, None, {}) + return cls(pipeline_response, None, response_headers) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}"} # type: ignore + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}" + } + + @distributed_trace + def begin_delete( + self, resource_group_name: str, security_connector_name: str, rule_id: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a Governance rule over a given scope. + + :param resource_group_name: The name of the resource group within the user's subscription. The + name is case insensitive. Required. + :type resource_group_name: str + :param security_connector_name: The security connector name. Required. + :type security_connector_name: str + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: Literal["2022-01-01-preview"] = kwargs.pop( + "api_version", _params.pop("api-version", "2022-01-01-preview") + ) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + security_connector_name=security_connector_name, + rule_id=rule_id, + 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): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + 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_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_subscription_governance_rules_execute_status_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_subscription_governance_rules_operation_result_operations.py similarity index 53% rename from sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_subscription_governance_rules_execute_status_operations.py rename to sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_subscription_governance_rules_operation_result_operations.py index cc18a6fa6af6..1d6674a0f067 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_subscription_governance_rules_execute_status_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/operations/_subscription_governance_rules_operation_result_operations.py @@ -7,7 +7,7 @@ # 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 typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -19,12 +19,10 @@ ) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models from ..._serialization import Serializer @@ -45,9 +43,9 @@ def build_get_request(rule_id: str, operation_id: str, subscription_id: str, **k _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +61,7 @@ def build_get_request(rule_id: str, operation_id: str, subscription_id: str, **k "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -74,14 +72,14 @@ def build_get_request(rule_id: str, operation_id: str, subscription_id: str, **k return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class SubscriptionGovernanceRulesExecuteStatusOperations: +class SubscriptionGovernanceRulesOperationResultOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.security.v2022_01_01_preview.SecurityCenter`'s - :attr:`subscription_governance_rules_execute_status` attribute. + :attr:`subscription_governance_rules_operation_result` attribute. """ models = _models @@ -93,7 +91,22 @@ 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") - def _get_initial(self, rule_id: str, operation_id: str, **kwargs: Any) -> Optional[_models.ExecuteRuleStatus]: + @distributed_trace + def get(self, rule_id: str, operation_id: str, **kwargs: Any) -> Optional[_models.OperationResultAutoGenerated]: + """Get governance rules long run operation result for the requested scope by ruleId and + operationId. + + :param rule_id: The governance rule key - unique key for the standard governance rule (GUID). + Required. + :type rule_id: str + :param operation_id: The governance rule execution key - unique key for the execution of + governance rule. Required. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationResultAutoGenerated or None or the result of cls(response) + :rtype: ~azure.mgmt.security.v2022_01_01_preview.models.OperationResultAutoGenerated or None + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -105,24 +118,24 @@ def _get_initial(self, rule_id: str, operation_id: str, **kwargs: Any) -> Option _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-01-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.ExecuteRuleStatus]] + ) + cls: ClsType[Optional[_models.OperationResultAutoGenerated]] = kwargs.pop("cls", None) request = build_get_request( rule_id=rule_id, operation_id=operation_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._get_initial.metadata["url"], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -135,7 +148,7 @@ def _get_initial(self, rule_id: str, operation_id: str, **kwargs: Any) -> Option deserialized = None response_headers = {} if response.status_code == 200: - deserialized = self._deserialize("ExecuteRuleStatus", pipeline_response) + deserialized = self._deserialize("OperationResultAutoGenerated", pipeline_response) if response.status_code == 202: response_headers["location"] = self._deserialize("str", response.headers.get("location")) @@ -145,74 +158,6 @@ def _get_initial(self, rule_id: str, operation_id: str, **kwargs: Any) -> Option return deserialized - _get_initial.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}"} # type: ignore - - @distributed_trace - def begin_get(self, rule_id: str, operation_id: str, **kwargs: Any) -> LROPoller[_models.ExecuteRuleStatus]: - """Get a specific governanceRule execution status for the requested scope by ruleId and - operationId. - - :param rule_id: The security GovernanceRule key - unique key for the standard GovernanceRule. - Required. - :type rule_id: str - :param operation_id: The security GovernanceRule execution key - unique key for the execution - of GovernanceRule. Required. - :type operation_id: 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 ExecuteRuleStatus or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.security.v2022_01_01_preview.models.ExecuteRuleStatus] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version = kwargs.pop( - "api_version", _params.pop("api-version", "2022-01-01-preview") - ) # type: Literal["2022-01-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ExecuteRuleStatus] - polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] - if cont_token is None: - raw_result = self._get_initial( # type: ignore - rule_id=rule_id, - operation_id=operation_id, - 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("ExecuteRuleStatus", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod - 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) - - begin_get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_configuration.py index 1f9210f091e9..617179e3e3e1 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-03-01") # type: Literal["2022-03-01"] + api_version: Literal["2022-03-01"] = kwargs.pop("api_version", "2022-03-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_metadata.json index 89b310cffc2b..ed951c2046be 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_security_center.py index 939eccf165e7..9e900c03debf 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import PricingsOperations @@ -48,7 +48,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -76,15 +76,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/_configuration.py index f46270fe370c..9e619b0f90e8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-03-01") # type: Literal["2022-03-01"] + api_version: Literal["2022-03-01"] = kwargs.pop("api_version", "2022-03-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/_security_center.py index fab10ae9528a..fe4aa3e864fd 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import PricingsOperations @@ -48,7 +48,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/operations/__init__.py index 81b7ce3e1103..3f34d5a48636 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/operations/__init__.py @@ -9,7 +9,7 @@ from ._pricings_operations import PricingsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/operations/_pricings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/operations/_pricings_operations.py index f7139469b6e8..2bc0d8154788 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/operations/_pricings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/aio/operations/_pricings_operations.py @@ -75,8 +75,8 @@ async def list(self, **kwargs: Any) -> _models.PricingList: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PricingList] + api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + cls: ClsType[_models.PricingList] = kwargs.pop("cls", None) request = build_list_request( subscription_id=self._config.subscription_id, @@ -86,9 +86,9 @@ async def list(self, **kwargs: Any) -> _models.PricingList: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -105,7 +105,7 @@ async def list(self, **kwargs: Any) -> _models.PricingList: return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings"} @distributed_trace_async async def get(self, pricing_name: str, **kwargs: Any) -> _models.Pricing: @@ -129,8 +129,8 @@ async def get(self, pricing_name: str, **kwargs: Any) -> _models.Pricing: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Pricing] + api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + cls: ClsType[_models.Pricing] = kwargs.pop("cls", None) request = build_get_request( pricing_name=pricing_name, @@ -141,9 +141,9 @@ async def get(self, pricing_name: str, **kwargs: Any) -> _models.Pricing: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -160,7 +160,7 @@ async def get(self, pricing_name: str, **kwargs: Any) -> _models.Pricing: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"} @overload async def update( @@ -227,9 +227,9 @@ async def update(self, pricing_name: str, pricing: Union[_models.Pricing, IO], * _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Pricing] + api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pricing] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -251,9 +251,9 @@ async def update(self, pricing_name: str, pricing: Union[_models.Pricing, IO], * params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -270,4 +270,4 @@ async def update(self, pricing_name: str, pricing: Union[_models.Pricing, IO], * return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"} # type: ignore + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/models/__init__.py index a6335e2b1d2d..82e99d49aec6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/models/__init__.py @@ -14,7 +14,7 @@ from ._security_center_enums import PricingTier from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/operations/__init__.py index 81b7ce3e1103..3f34d5a48636 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/operations/__init__.py @@ -9,7 +9,7 @@ from ._pricings_operations import PricingsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/operations/_pricings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/operations/_pricings_operations.py index ae0053fbc7f8..56720dc894f0 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/operations/_pricings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/operations/_pricings_operations.py @@ -43,7 +43,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] + api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,7 +54,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -69,7 +69,7 @@ def build_get_request(pricing_name: str, subscription_id: str, **kwargs: Any) -> _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] + api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +83,7 @@ def build_get_request(pricing_name: str, subscription_id: str, **kwargs: Any) -> "pricingName": _SERIALIZER.url("pricing_name", pricing_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -98,8 +98,8 @@ def build_update_request(pricing_name: str, subscription_id: str, **kwargs: Any) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +113,7 @@ def build_update_request(pricing_name: str, subscription_id: str, **kwargs: Any) "pricingName": _SERIALIZER.url("pricing_name", pricing_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -165,8 +165,8 @@ def list(self, **kwargs: Any) -> _models.PricingList: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.PricingList] + api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + cls: ClsType[_models.PricingList] = kwargs.pop("cls", None) request = build_list_request( subscription_id=self._config.subscription_id, @@ -176,9 +176,9 @@ def list(self, **kwargs: Any) -> _models.PricingList: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -195,7 +195,7 @@ def list(self, **kwargs: Any) -> _models.PricingList: return deserialized - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings"} @distributed_trace def get(self, pricing_name: str, **kwargs: Any) -> _models.Pricing: @@ -219,8 +219,8 @@ def get(self, pricing_name: str, **kwargs: Any) -> _models.Pricing: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Pricing] + api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + cls: ClsType[_models.Pricing] = kwargs.pop("cls", None) request = build_get_request( pricing_name=pricing_name, @@ -231,9 +231,9 @@ def get(self, pricing_name: str, **kwargs: Any) -> _models.Pricing: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -250,7 +250,7 @@ def get(self, pricing_name: str, **kwargs: Any) -> _models.Pricing: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"} @overload def update( @@ -317,9 +317,9 @@ def update(self, pricing_name: str, pricing: Union[_models.Pricing, IO], **kwarg _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: Literal["2022-03-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Pricing] + api_version: Literal["2022-03-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Pricing] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -341,9 +341,9 @@ def update(self, pricing_name: str, pricing: Union[_models.Pricing, IO], **kwarg params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -360,4 +360,4 @@ def update(self, pricing_name: str, pricing: Union[_models.Pricing, IO], **kwarg return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"} # type: ignore + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_configuration.py index cc031b97ea90..a89bf26be25f 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-05-01") # type: Literal["2022-05-01"] + api_version: Literal["2022-05-01"] = kwargs.pop("api_version", "2022-05-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_metadata.json index 47a3ee3d7feb..f1469a211b3a 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_security_center.py index 0a472cc8411e..f9e21a8b7346 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import SettingsOperations @@ -48,7 +48,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -76,15 +76,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/_configuration.py index 74da18d1fbd7..4e3b5f425006 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-05-01") # type: Literal["2022-05-01"] + api_version: Literal["2022-05-01"] = kwargs.pop("api_version", "2022-05-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/_security_center.py index 69a74305392a..eadcd9f859e2 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import SettingsOperations @@ -48,7 +48,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/operations/__init__.py index 0b0925b026d7..1046445c98b6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/operations/__init__.py @@ -9,7 +9,7 @@ from ._settings_operations import SettingsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/operations/_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/operations/_settings_operations.py index fc65f030d9dd..a510ad04b4b6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/operations/_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/aio/operations/_settings_operations.py @@ -71,8 +71,8 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Setting"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) # type: Literal["2022-05-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SettingsList] + api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + cls: ClsType[_models.SettingsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -93,7 +93,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -109,7 +109,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -117,13 +117,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SettingsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -136,7 +136,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings"} @distributed_trace_async async def get(self, setting_name: Union[str, _models.SettingName], **kwargs: Any) -> _models.Setting: @@ -161,8 +161,8 @@ async def get(self, setting_name: Union[str, _models.SettingName], **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) # type: Literal["2022-05-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Setting] + api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + cls: ClsType[_models.Setting] = kwargs.pop("cls", None) request = build_get_request( setting_name=setting_name, @@ -173,9 +173,9 @@ async def get(self, setting_name: Union[str, _models.SettingName], **kwargs: Any params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -192,7 +192,7 @@ async def get(self, setting_name: Union[str, _models.SettingName], **kwargs: Any return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} @overload async def update( @@ -274,9 +274,9 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) # type: Literal["2022-05-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Setting] + api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Setting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -298,9 +298,9 @@ async def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -317,4 +317,4 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} # type: ignore + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/models/__init__.py index 63e5f8c91733..ce862c57b5f2 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/models/__init__.py @@ -17,7 +17,7 @@ from ._security_center_enums import SettingKind from ._security_center_enums import SettingName from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/models/_models_py3.py index 32f113ef85a8..765138b56916 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/models/_models_py3.py @@ -85,7 +85,7 @@ class Setting(Resource): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.kind = None # type: Optional[str] + self.kind: Optional[str] = None class AlertSyncSettings(Setting): @@ -129,7 +129,7 @@ def __init__(self, *, enabled: Optional[bool] = None, **kwargs): :paramtype enabled: bool """ super().__init__(**kwargs) - self.kind = "AlertSyncSettings" # type: str + self.kind: str = "AlertSyncSettings" self.enabled = enabled @@ -217,7 +217,7 @@ def __init__(self, *, enabled: Optional[bool] = None, **kwargs): :paramtype enabled: bool """ super().__init__(**kwargs) - self.kind = "DataExportSettings" # type: str + self.kind: str = "DataExportSettings" self.enabled = enabled diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/operations/__init__.py index 0b0925b026d7..1046445c98b6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/operations/__init__.py @@ -9,7 +9,7 @@ from ._settings_operations import SettingsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/operations/_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/operations/_settings_operations.py index 9bfd1bb6817b..452b6b52cb15 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/operations/_settings_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/operations/_settings_operations.py @@ -45,7 +45,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 = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) # type: Literal["2022-05-01"] + api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,7 +73,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) # type: Literal["2022-05-01"] + api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +87,7 @@ def build_get_request( "settingName": _SERIALIZER.url("setting_name", setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -104,8 +104,8 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) # type: Literal["2022-05-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -119,7 +119,7 @@ def build_update_request( "settingName": _SERIALIZER.url("setting_name", setting_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,8 +163,8 @@ def list(self, **kwargs: Any) -> Iterable["_models.Setting"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) # type: Literal["2022-05-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SettingsList] + api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + cls: ClsType[_models.SettingsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -185,7 +185,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -201,7 +201,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -209,13 +209,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SettingsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -228,7 +228,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings"} @distributed_trace def get(self, setting_name: Union[str, _models.SettingName], **kwargs: Any) -> _models.Setting: @@ -253,8 +253,8 @@ def get(self, setting_name: Union[str, _models.SettingName], **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) # type: Literal["2022-05-01"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Setting] + api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + cls: ClsType[_models.Setting] = kwargs.pop("cls", None) request = build_get_request( setting_name=setting_name, @@ -265,9 +265,9 @@ def get(self, setting_name: Union[str, _models.SettingName], **kwargs: Any) -> _ params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -284,7 +284,7 @@ def get(self, setting_name: Union[str, _models.SettingName], **kwargs: Any) -> _ return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} @overload def update( @@ -366,9 +366,9 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) # type: Literal["2022-05-01"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Setting] + api_version: Literal["2022-05-01"] = kwargs.pop("api_version", _params.pop("api-version", "2022-05-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Setting] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -390,9 +390,9 @@ def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -409,4 +409,4 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} # type: ignore + update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_configuration.py index 28502606ce6d..d8bc7452ee6d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-05-01-preview") # type: Literal["2022-05-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop("api_version", "2022-05-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_metadata.json index 8f808801f946..5338ba339995 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_security_center.py index c460ae0e2da1..f0dc865b3eaf 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import SecurityConnectorsOperations @@ -49,7 +49,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -79,15 +79,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/_configuration.py index 2c12da03e992..736771f1e9a7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-05-01-preview") # type: Literal["2022-05-01-preview"] + api_version: Literal["2022-05-01-preview"] = kwargs.pop("api_version", "2022-05-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/_security_center.py index 2aecef4febdc..e362854e1e16 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import SecurityConnectorsOperations @@ -49,7 +49,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/operations/__init__.py index 4660a96abf0f..8e4ac6c4f04e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/operations/__init__.py @@ -9,7 +9,7 @@ from ._security_connectors_operations import SecurityConnectorsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/operations/_security_connectors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/operations/_security_connectors_operations.py index 3f7a149b2b74..f524441b44ce 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/operations/_security_connectors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/aio/operations/_security_connectors_operations.py @@ -79,10 +79,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.SecurityConnector"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnectorsList] + ) + cls: ClsType[_models.SecurityConnectorsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -103,7 +103,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -119,7 +119,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -127,13 +127,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityConnectorsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -146,7 +146,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors"} @distributed_trace def list_by_resource_group( @@ -167,10 +167,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnectorsList] + ) + cls: ClsType[_models.SecurityConnectorsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -192,7 +192,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -208,7 +208,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -216,13 +216,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityConnectorsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -235,7 +235,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors" + } @distributed_trace_async async def get( @@ -264,10 +266,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -279,9 +281,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -298,7 +300,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @overload async def create_or_update( @@ -397,11 +401,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -424,9 +428,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -443,11 +447,13 @@ async def create_or_update( deserialized = self._deserialize("SecurityConnector", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @overload async def update( @@ -543,11 +549,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -570,9 +576,9 @@ async def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -589,7 +595,9 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -618,10 +626,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -633,9 +641,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -648,4 +656,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/models/__init__.py index 53ad2709ca23..a72e752d54cd 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/models/__init__.py @@ -83,7 +83,7 @@ from ._security_center_enums import SubPlan from ._security_center_enums import Type from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/models/_models_py3.py index 7328d7eb9110..0d14304a98ac 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/models/_models_py3.py @@ -59,7 +59,7 @@ class EnvironmentData(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.environment_type = None # type: Optional[str] + self.environment_type: Optional[str] = None class AWSEnvironmentData(EnvironmentData): @@ -92,7 +92,7 @@ def __init__(self, *, organizational_data: Optional["_models.AwsOrganizationalDa ~azure.mgmt.security.v2022_05_01_preview.models.AwsOrganizationalData """ super().__init__(**kwargs) - self.environment_type = "AwsAccount" # type: str + self.environment_type: str = "AwsAccount" self.organizational_data = organizational_data @@ -128,7 +128,7 @@ class AwsOrganizationalData(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.organization_membership_type = None # type: Optional[str] + self.organization_membership_type: Optional[str] = None class AwsOrganizationalDataMaster(AwsOrganizationalData): @@ -170,7 +170,7 @@ def __init__( :paramtype excluded_account_ids: list[str] """ super().__init__(**kwargs) - self.organization_membership_type = "Organization" # type: str + self.organization_membership_type: str = "Organization" self.stackset_name = stackset_name self.excluded_account_ids = excluded_account_ids @@ -205,7 +205,7 @@ def __init__(self, *, parent_hierarchy_id: Optional[str] = None, **kwargs): :paramtype parent_hierarchy_id: str """ super().__init__(**kwargs) - self.organization_membership_type = "Member" # type: str + self.organization_membership_type: str = "Member" self.parent_hierarchy_id = parent_hierarchy_id @@ -231,7 +231,7 @@ class AzureDevOpsScopeEnvironmentData(EnvironmentData): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.environment_type = "AzureDevOpsScope" # type: str + self.environment_type: str = "AzureDevOpsScope" class AzureTrackedResourceLocation(_serialization.Model): @@ -350,7 +350,7 @@ class CloudOffering(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.offering_type = None # type: Optional[str] + self.offering_type: Optional[str] = None self.description = None @@ -400,7 +400,7 @@ def __init__( ~azure.mgmt.security.v2022_05_01_preview.models.CspmMonitorAwsOfferingNativeCloudConnection """ super().__init__(**kwargs) - self.offering_type = "CspmMonitorAws" # type: str + self.offering_type: str = "CspmMonitorAws" self.native_cloud_connection = native_cloud_connection @@ -454,7 +454,7 @@ class CspmMonitorAzureDevOpsOffering(CloudOffering): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.offering_type = "CspmMonitorAzureDevOps" # type: str + self.offering_type: str = "CspmMonitorAzureDevOps" class CspmMonitorGcpOffering(CloudOffering): @@ -503,7 +503,7 @@ def __init__( ~azure.mgmt.security.v2022_05_01_preview.models.CspmMonitorGcpOfferingNativeCloudConnection """ super().__init__(**kwargs) - self.offering_type = "CspmMonitorGcp" # type: str + self.offering_type: str = "CspmMonitorGcp" self.native_cloud_connection = native_cloud_connection @@ -571,7 +571,7 @@ class CspmMonitorGithubOffering(CloudOffering): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.offering_type = "CspmMonitorGithub" # type: str + self.offering_type: str = "CspmMonitorGithub" class DefenderFoDatabasesAwsOffering(CloudOffering): @@ -620,7 +620,7 @@ def __init__( ~azure.mgmt.security.v2022_05_01_preview.models.DefenderFoDatabasesAwsOfferingArcAutoProvisioning """ super().__init__(**kwargs) - self.offering_type = "DefenderForDatabasesAws" # type: str + self.offering_type: str = "DefenderForDatabasesAws" self.arc_auto_provisioning = arc_auto_provisioning @@ -843,7 +843,7 @@ def __init__( :paramtype scuba_external_id: str """ super().__init__(**kwargs) - self.offering_type = "DefenderForContainersAws" # type: str + self.offering_type: str = "DefenderForContainersAws" self.kubernetes_service = kubernetes_service self.kubernetes_scuba_reader = kubernetes_scuba_reader self.cloud_watch_to_kinesis = cloud_watch_to_kinesis @@ -1061,7 +1061,7 @@ def __init__( :paramtype policy_agent_auto_provisioning_flag: bool """ super().__init__(**kwargs) - self.offering_type = "DefenderForContainersGcp" # type: str + self.offering_type: str = "DefenderForContainersGcp" self.native_cloud_connection = native_cloud_connection self.data_pipeline_native_cloud_connection = data_pipeline_native_cloud_connection self.audit_logs_auto_provisioning_flag = audit_logs_auto_provisioning_flag @@ -1200,7 +1200,7 @@ def __init__( ~azure.mgmt.security.v2022_05_01_preview.models.DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning """ super().__init__(**kwargs) - self.offering_type = "DefenderForDatabasesGcp" # type: str + self.offering_type: str = "DefenderForDatabasesGcp" self.arc_auto_provisioning = arc_auto_provisioning self.defender_for_databases_arc_auto_provisioning = defender_for_databases_arc_auto_provisioning @@ -1408,7 +1408,7 @@ def __init__( ~azure.mgmt.security.v2022_05_01_preview.models.DefenderForServersAwsOfferingVmScanners """ super().__init__(**kwargs) - self.offering_type = "DefenderForServersAws" # type: str + self.offering_type: str = "DefenderForServersAws" self.defender_for_servers = defender_for_servers self.arc_auto_provisioning = arc_auto_provisioning self.va_auto_provisioning = va_auto_provisioning @@ -1791,7 +1791,7 @@ def __init__( ~azure.mgmt.security.v2022_05_01_preview.models.DefenderForServersGcpOfferingSubPlan """ super().__init__(**kwargs) - self.offering_type = "DefenderForServersGcp" # type: str + self.offering_type: str = "DefenderForServersGcp" self.defender_for_servers = defender_for_servers self.arc_auto_provisioning = arc_auto_provisioning self.va_auto_provisioning = va_auto_provisioning @@ -2091,7 +2091,7 @@ class GcpOrganizationalData(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.organization_membership_type = None # type: Optional[str] + self.organization_membership_type: Optional[str] = None class GcpOrganizationalDataMember(GcpOrganizationalData): @@ -2133,7 +2133,7 @@ def __init__( :paramtype management_project_number: str """ super().__init__(**kwargs) - self.organization_membership_type = "Member" # type: str + self.organization_membership_type: str = "Member" self.parent_hierarchy_id = parent_hierarchy_id self.management_project_number = management_project_number @@ -2189,7 +2189,7 @@ def __init__( :paramtype workload_identity_provider_id: str """ super().__init__(**kwargs) - self.organization_membership_type = "Organization" # type: str + self.organization_membership_type: str = "Organization" self.excluded_project_numbers = excluded_project_numbers self.service_account_email_address = service_account_email_address self.workload_identity_provider_id = workload_identity_provider_id @@ -2272,7 +2272,7 @@ def __init__( :paramtype project_details: ~azure.mgmt.security.v2022_05_01_preview.models.GcpProjectDetails """ super().__init__(**kwargs) - self.environment_type = "GcpProject" # type: str + self.environment_type: str = "GcpProject" self.organizational_data = organizational_data self.project_details = project_details @@ -2299,7 +2299,7 @@ class GithubScopeEnvironmentData(EnvironmentData): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.environment_type = "GithubScope" # type: str + self.environment_type: str = "GithubScope" class InformationProtectionAwsOffering(CloudOffering): @@ -2348,7 +2348,7 @@ def __init__( ~azure.mgmt.security.v2022_05_01_preview.models.InformationProtectionAwsOfferingInformationProtection """ super().__init__(**kwargs) - self.offering_type = "InformationProtectionAws" # type: str + self.offering_type: str = "InformationProtectionAws" self.information_protection = information_protection diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/operations/__init__.py index 4660a96abf0f..8e4ac6c4f04e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/operations/__init__.py @@ -9,7 +9,7 @@ from ._security_connectors_operations import SecurityConnectorsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/operations/_security_connectors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/operations/_security_connectors_operations.py index dfc75e6d5f8c..ac95629467f3 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/operations/_security_connectors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/operations/_security_connectors_operations.py @@ -45,9 +45,9 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,9 +73,9 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -109,9 +109,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -129,7 +129,7 @@ def build_get_request( "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,10 +146,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -167,7 +167,7 @@ def build_create_or_update_request( "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -186,10 +186,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +207,7 @@ def build_update_request( "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -226,9 +226,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -246,7 +246,7 @@ def build_delete_request( "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -290,10 +290,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.SecurityConnector"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnectorsList] + ) + cls: ClsType[_models.SecurityConnectorsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -314,7 +314,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -330,7 +330,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -338,13 +338,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityConnectorsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -357,7 +357,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors"} @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.SecurityConnector"]: @@ -376,10 +376,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnectorsList] + ) + cls: ClsType[_models.SecurityConnectorsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -401,7 +401,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -417,7 +417,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -425,13 +425,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityConnectorsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -444,7 +444,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors" + } @distributed_trace def get(self, resource_group_name: str, security_connector_name: str, **kwargs: Any) -> _models.SecurityConnector: @@ -471,10 +473,10 @@ def get(self, resource_group_name: str, security_connector_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -486,9 +488,9 @@ def get(self, resource_group_name: str, security_connector_name: str, **kwargs: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -505,7 +507,9 @@ def get(self, resource_group_name: str, security_connector_name: str, **kwargs: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @overload def create_or_update( @@ -604,11 +608,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -631,9 +635,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -650,11 +654,13 @@ def create_or_update( deserialized = self._deserialize("SecurityConnector", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @overload def update( @@ -750,11 +756,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -777,9 +783,9 @@ def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -796,7 +802,9 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -825,10 +833,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-05-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-05-01-preview") - ) # type: Literal["2022-05-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -840,9 +848,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -855,4 +863,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_configuration.py index 19075a8c40b3..98fe9a4d9888 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-07-01-preview") # type: Literal["2022-07-01-preview"] + api_version: Literal["2022-07-01-preview"] = kwargs.pop("api_version", "2022-07-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_metadata.json index 934d3a1b93c2..93d5f1359d35 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_security_center.py index 4b2867e2c902..466e65cad772 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ( @@ -62,7 +62,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -97,15 +97,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/_configuration.py index 5caa1ff7da9b..bd02ffa6504e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-07-01-preview") # type: Literal["2022-07-01-preview"] + api_version: Literal["2022-07-01-preview"] = kwargs.pop("api_version", "2022-07-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/_security_center.py index eb0b06d00415..b1a6b1a4bff0 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import ( @@ -63,7 +63,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/__init__.py index 61c6546366e5..c85f8d56b434 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/__init__.py @@ -12,7 +12,7 @@ from ._security_connector_application_operations import SecurityConnectorApplicationOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/_application_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/_application_operations.py index 85dc02912d07..21c2761e9499 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/_application_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/_application_operations.py @@ -82,10 +82,10 @@ async def get(self, application_id: str, **kwargs: Any) -> _models.Application: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Application] + ) + cls: ClsType[_models.Application] = kwargs.pop("cls", None) request = build_get_request( application_id=application_id, @@ -96,9 +96,9 @@ async def get(self, application_id: str, **kwargs: Any) -> _models.Application: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -115,7 +115,7 @@ async def get(self, application_id: str, **kwargs: Any) -> _models.Application: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}"} @overload async def create_or_update( @@ -193,11 +193,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Application] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Application] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -219,9 +219,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -238,11 +238,13 @@ async def create_or_update( deserialized = self._deserialize("Application", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -269,10 +271,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( application_id=application_id, @@ -283,9 +285,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -298,4 +300,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/_applications_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/_applications_operations.py index 007fca2dda37..10450d905899 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/_applications_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/_applications_operations.py @@ -70,10 +70,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Application"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationsList] + ) + cls: ClsType[_models.ApplicationsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -94,7 +94,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -110,7 +110,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -118,13 +118,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -137,4 +137,4 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/_security_connector_application_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/_security_connector_application_operations.py index 9d8b5af8b8ef..08803da8d736 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/_security_connector_application_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/_security_connector_application_operations.py @@ -89,10 +89,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Application] + ) + cls: ClsType[_models.Application] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -105,9 +105,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -124,7 +124,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}" + } @overload async def create_or_update( @@ -231,11 +233,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Application] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Application] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -259,9 +261,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -278,11 +280,13 @@ async def create_or_update( deserialized = self._deserialize("Application", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -314,10 +318,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -330,9 +334,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -345,4 +349,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/_security_connector_applications_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/_security_connector_applications_operations.py index 92eaa30a2497..e76ca3618db5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/_security_connector_applications_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/aio/operations/_security_connector_applications_operations.py @@ -77,10 +77,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationsList] + ) + cls: ClsType[_models.ApplicationsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -103,7 +103,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -119,7 +119,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -127,13 +127,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -146,4 +146,6 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/models/__init__.py index 686374128fc6..0958c7d80773 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/models/__init__.py @@ -16,7 +16,7 @@ from ._security_center_enums import ApplicationConditionOperator from ._security_center_enums import ApplicationSourceResourceType from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/__init__.py index 61c6546366e5..c85f8d56b434 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/__init__.py @@ -12,7 +12,7 @@ from ._security_connector_application_operations import SecurityConnectorApplicationOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/_application_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/_application_operations.py index e84db16005c4..08769c25f635 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/_application_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/_application_operations.py @@ -43,9 +43,9 @@ def build_get_request(application_id: str, subscription_id: str, **kwargs: Any) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_get_request(application_id: str, subscription_id: str, **kwargs: Any) "applicationId": _SERIALIZER.url("application_id", application_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -74,10 +74,10 @@ def build_create_or_update_request(application_id: str, subscription_id: str, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,7 +91,7 @@ def build_create_or_update_request(application_id: str, subscription_id: str, ** "applicationId": _SERIALIZER.url("application_id", application_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,9 +107,9 @@ def build_create_or_update_request(application_id: str, subscription_id: str, ** def build_delete_request(application_id: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}" @@ -121,7 +121,7 @@ def build_delete_request(application_id: str, subscription_id: str, **kwargs: An "applicationId": _SERIALIZER.url("application_id", application_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -171,10 +171,10 @@ def get(self, application_id: str, **kwargs: Any) -> _models.Application: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Application] + ) + cls: ClsType[_models.Application] = kwargs.pop("cls", None) request = build_get_request( application_id=application_id, @@ -185,9 +185,9 @@ def get(self, application_id: str, **kwargs: Any) -> _models.Application: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -204,7 +204,7 @@ def get(self, application_id: str, **kwargs: Any) -> _models.Application: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}"} @overload def create_or_update( @@ -282,11 +282,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Application] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Application] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -308,9 +308,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -327,11 +327,13 @@ def create_or_update( deserialized = self._deserialize("Application", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}" + } @distributed_trace def delete(self, application_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements @@ -356,10 +358,10 @@ def delete(self, application_id: str, **kwargs: Any) -> None: # pylint: disable _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( application_id=application_id, @@ -370,9 +372,9 @@ def delete(self, application_id: str, **kwargs: Any) -> None: # pylint: disable params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -385,4 +387,6 @@ def delete(self, application_id: str, **kwargs: Any) -> None: # pylint: disable if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/_applications_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/_applications_operations.py index f8006290b71d..e8b5eb53e499 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/_applications_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/_applications_operations.py @@ -45,9 +45,9 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -101,10 +101,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.Application"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationsList] + ) + cls: ClsType[_models.ApplicationsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -125,7 +125,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -141,7 +141,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -149,13 +149,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -168,4 +168,4 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/_security_connector_application_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/_security_connector_application_operations.py index 291bb2803f03..10f049276317 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/_security_connector_application_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/_security_connector_application_operations.py @@ -45,9 +45,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -66,7 +66,7 @@ def build_get_request( "applicationId": _SERIALIZER.url("application_id", application_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -83,10 +83,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_create_or_update_request( "applicationId": _SERIALIZER.url("application_id", application_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -123,9 +123,9 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] + ) # Construct URL _url = kwargs.pop( "template_url", @@ -142,7 +142,7 @@ def build_delete_request( "applicationId": _SERIALIZER.url("application_id", application_id, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -199,10 +199,10 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Application] + ) + cls: ClsType[_models.Application] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -215,9 +215,9 @@ def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -234,7 +234,9 @@ def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}" + } @overload def create_or_update( @@ -341,11 +343,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.Application] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Application] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -369,9 +371,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -388,11 +390,13 @@ def create_or_update( deserialized = self._deserialize("Application", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -424,10 +428,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -440,9 +444,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -455,4 +459,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/_security_connector_applications_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/_security_connector_applications_operations.py index 858b1ef83b94..354fb4dc565d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/_security_connector_applications_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/operations/_security_connector_applications_operations.py @@ -47,9 +47,9 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +67,7 @@ def build_list_request( "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -117,10 +117,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-07-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-07-01-preview") - ) # type: Literal["2022-07-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.ApplicationsList] + ) + cls: ClsType[_models.ApplicationsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -143,7 +143,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -159,7 +159,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -167,13 +167,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("ApplicationsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -186,4 +186,6 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications"} # type: ignore + list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/__init__.py index b4893ccdf609..e95a015ca6b8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/__init__.py @@ -13,7 +13,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_configuration.py index f5c6e9e2a86e..d05f1ca002f7 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-08-01-preview") # type: Literal["2022-08-01-preview"] + api_version: Literal["2022-08-01-preview"] = kwargs.pop("api_version", "2022-08-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -56,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None + def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_metadata.json index e9aceb5f52df..ed872cbcc7fb 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_metadata.json @@ -48,7 +48,7 @@ "service_client_specific": { "sync": { "api_version": { - "signature": "api_version=None, # type: Optional[str]", + "signature": "api_version: Optional[str]=None,", "description": "API version to use if no profile is provided, or if missing in profile.", "docstring_type": "str", "required": false @@ -60,7 +60,7 @@ "required": false }, "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "signature": "profile: KnownProfiles=KnownProfiles.default,", "description": "A profile definition, from KnownProfiles to dict.", "docstring_type": "azure.profiles.KnownProfiles", "required": false diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_security_center.py index db8abdba93dc..0849fcf2bc61 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from .._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import SecurityConnectorsOperations @@ -49,7 +49,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False @@ -79,15 +79,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> SecurityCenter + def __enter__(self) -> "SecurityCenter": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/__init__.py index 5b78291ec454..d9a53c22b3e6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/__init__.py @@ -10,7 +10,7 @@ try: from ._patch import __all__ as _patch_all - from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import + from ._patch import * # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/_configuration.py index c5692cc3dbe4..9c11d7c3fdd6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/_configuration.py @@ -42,7 +42,7 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-08-01-preview") # type: Literal["2022-08-01-preview"] + api_version: Literal["2022-08-01-preview"] = kwargs.pop("api_version", "2022-08-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/_security_center.py index ce5d099e1e9a..cf3db08f0a7f 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/_security_center.py @@ -12,7 +12,7 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models from ..._serialization import Deserializer, Serializer from ._configuration import SecurityCenterConfiguration from .operations import SecurityConnectorsOperations @@ -49,7 +49,7 @@ def __init__( self._config = SecurityCenterConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/operations/__init__.py index 4660a96abf0f..8e4ac6c4f04e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/operations/__init__.py @@ -9,7 +9,7 @@ from ._security_connectors_operations import SecurityConnectorsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/operations/_security_connectors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/operations/_security_connectors_operations.py index 342f7cc07e99..8aed71b2e9d8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/operations/_security_connectors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/aio/operations/_security_connectors_operations.py @@ -79,10 +79,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.SecurityConnector"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnectorsList] + ) + cls: ClsType[_models.SecurityConnectorsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -103,7 +103,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -119,7 +119,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -127,13 +127,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityConnectorsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -146,7 +146,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors"} @distributed_trace def list_by_resource_group( @@ -167,10 +167,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnectorsList] + ) + cls: ClsType[_models.SecurityConnectorsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -192,7 +192,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -208,7 +208,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -216,13 +216,13 @@ async def extract_data(pipeline_response): deserialized = self._deserialize("SecurityConnectorsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -235,7 +235,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors" + } @distributed_trace_async async def get( @@ -264,10 +266,10 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -279,9 +281,9 @@ async def get( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -298,7 +300,9 @@ async def get( return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @overload async def create_or_update( @@ -397,11 +401,11 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -424,9 +428,9 @@ async def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -443,11 +447,13 @@ async def create_or_update( deserialized = self._deserialize("SecurityConnector", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @overload async def update( @@ -543,11 +549,11 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -570,9 +576,9 @@ async def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -589,7 +595,9 @@ async def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements @@ -618,10 +626,10 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -633,9 +641,9 @@ async def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -648,4 +656,6 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/models/__init__.py index 3ae38c38dc10..15b0d0a8e79b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/models/__init__.py @@ -86,7 +86,7 @@ from ._security_center_enums import SubPlan from ._security_center_enums import Type from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/models/_models_py3.py index 29f7a7f69034..9753f51071d0 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/models/_models_py3.py @@ -59,7 +59,7 @@ class EnvironmentData(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.environment_type = None # type: Optional[str] + self.environment_type: Optional[str] = None class AwsEnvironmentData(EnvironmentData): @@ -92,7 +92,7 @@ def __init__(self, *, organizational_data: Optional["_models.AwsOrganizationalDa ~azure.mgmt.security.v2022_08_01_preview.models.AwsOrganizationalData """ super().__init__(**kwargs) - self.environment_type = "AwsAccount" # type: str + self.environment_type: str = "AwsAccount" self.organizational_data = organizational_data @@ -128,7 +128,7 @@ class AwsOrganizationalData(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.organization_membership_type = None # type: Optional[str] + self.organization_membership_type: Optional[str] = None class AwsOrganizationalDataMaster(AwsOrganizationalData): @@ -170,7 +170,7 @@ def __init__( :paramtype excluded_account_ids: list[str] """ super().__init__(**kwargs) - self.organization_membership_type = "Organization" # type: str + self.organization_membership_type: str = "Organization" self.stackset_name = stackset_name self.excluded_account_ids = excluded_account_ids @@ -205,7 +205,7 @@ def __init__(self, *, parent_hierarchy_id: Optional[str] = None, **kwargs): :paramtype parent_hierarchy_id: str """ super().__init__(**kwargs) - self.organization_membership_type = "Member" # type: str + self.organization_membership_type: str = "Member" self.parent_hierarchy_id = parent_hierarchy_id @@ -231,7 +231,7 @@ class AzureDevOpsScopeEnvironmentData(EnvironmentData): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.environment_type = "AzureDevOpsScope" # type: str + self.environment_type: str = "AzureDevOpsScope" class AzureTrackedResourceLocation(_serialization.Model): @@ -357,7 +357,7 @@ class CloudOffering(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.offering_type = None # type: Optional[str] + self.offering_type: Optional[str] = None self.description = None @@ -408,7 +408,7 @@ def __init__( ~azure.mgmt.security.v2022_08_01_preview.models.CspmMonitorAwsOfferingNativeCloudConnection """ super().__init__(**kwargs) - self.offering_type = "CspmMonitorAws" # type: str + self.offering_type: str = "CspmMonitorAws" self.native_cloud_connection = native_cloud_connection @@ -463,7 +463,7 @@ class CspmMonitorAzureDevOpsOffering(CloudOffering): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.offering_type = "CspmMonitorAzureDevOps" # type: str + self.offering_type: str = "CspmMonitorAzureDevOps" class CspmMonitorGcpOffering(CloudOffering): @@ -513,7 +513,7 @@ def __init__( ~azure.mgmt.security.v2022_08_01_preview.models.CspmMonitorGcpOfferingNativeCloudConnection """ super().__init__(**kwargs) - self.offering_type = "CspmMonitorGcp" # type: str + self.offering_type: str = "CspmMonitorGcp" self.native_cloud_connection = native_cloud_connection @@ -582,7 +582,7 @@ class CspmMonitorGithubOffering(CloudOffering): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.offering_type = "CspmMonitorGithub" # type: str + self.offering_type: str = "CspmMonitorGithub" class DefenderCspmAwsOffering(CloudOffering): @@ -624,7 +624,7 @@ def __init__(self, *, vm_scanners: Optional["_models.DefenderCspmAwsOfferingVmSc ~azure.mgmt.security.v2022_08_01_preview.models.DefenderCspmAwsOfferingVmScanners """ super().__init__(**kwargs) - self.offering_type = "DefenderCspmAws" # type: str + self.offering_type: str = "DefenderCspmAws" self.vm_scanners = vm_scanners @@ -732,7 +732,7 @@ class DefenderCspmGcpOffering(CloudOffering): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.offering_type = "DefenderCspmGcp" # type: str + self.offering_type: str = "DefenderCspmGcp" class DefenderFoDatabasesAwsOffering(CloudOffering): @@ -789,7 +789,7 @@ def __init__( ~azure.mgmt.security.v2022_08_01_preview.models.DefenderFoDatabasesAwsOfferingRds """ super().__init__(**kwargs) - self.offering_type = "DefenderForDatabasesAws" # type: str + self.offering_type: str = "DefenderForDatabasesAws" self.arc_auto_provisioning = arc_auto_provisioning self.rds = rds @@ -979,7 +979,7 @@ def __init__( :paramtype scuba_external_id: str """ super().__init__(**kwargs) - self.offering_type = "DefenderForContainersAws" # type: str + self.offering_type: str = "DefenderForContainersAws" self.kubernetes_service = kubernetes_service self.kubernetes_scuba_reader = kubernetes_scuba_reader self.cloud_watch_to_kinesis = cloud_watch_to_kinesis @@ -1198,7 +1198,7 @@ def __init__( :paramtype policy_agent_auto_provisioning_flag: bool """ super().__init__(**kwargs) - self.offering_type = "DefenderForContainersGcp" # type: str + self.offering_type: str = "DefenderForContainersGcp" self.native_cloud_connection = native_cloud_connection self.data_pipeline_native_cloud_connection = data_pipeline_native_cloud_connection self.audit_logs_auto_provisioning_flag = audit_logs_auto_provisioning_flag @@ -1338,7 +1338,7 @@ def __init__( ~azure.mgmt.security.v2022_08_01_preview.models.DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning """ super().__init__(**kwargs) - self.offering_type = "DefenderForDatabasesGcp" # type: str + self.offering_type: str = "DefenderForDatabasesGcp" self.arc_auto_provisioning = arc_auto_provisioning self.defender_for_databases_arc_auto_provisioning = defender_for_databases_arc_auto_provisioning @@ -1429,7 +1429,7 @@ class DefenderForDevOpsAzureDevOpsOffering(CloudOffering): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.offering_type = "DefenderForDevOpsAzureDevOps" # type: str + self.offering_type: str = "DefenderForDevOpsAzureDevOps" class DefenderForDevOpsGithubOffering(CloudOffering): @@ -1463,7 +1463,7 @@ class DefenderForDevOpsGithubOffering(CloudOffering): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.offering_type = "DefenderForDevOpsGithub" # type: str + self.offering_type: str = "DefenderForDevOpsGithub" class DefenderForServersAwsOffering(CloudOffering): @@ -1564,7 +1564,7 @@ def __init__( ~azure.mgmt.security.v2022_08_01_preview.models.DefenderForServersAwsOfferingVmScanners """ super().__init__(**kwargs) - self.offering_type = "DefenderForServersAws" # type: str + self.offering_type: str = "DefenderForServersAws" self.defender_for_servers = defender_for_servers self.arc_auto_provisioning = arc_auto_provisioning self.va_auto_provisioning = va_auto_provisioning @@ -1887,7 +1887,7 @@ def __init__( ~azure.mgmt.security.v2022_08_01_preview.models.DefenderForServersGcpOfferingSubPlan """ super().__init__(**kwargs) - self.offering_type = "DefenderForServersGcp" # type: str + self.offering_type: str = "DefenderForServersGcp" self.defender_for_servers = defender_for_servers self.arc_auto_provisioning = arc_auto_provisioning self.va_auto_provisioning = va_auto_provisioning @@ -2136,7 +2136,7 @@ class GcpOrganizationalData(_serialization.Model): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.organization_membership_type = None # type: Optional[str] + self.organization_membership_type: Optional[str] = None class GcpOrganizationalDataMember(GcpOrganizationalData): @@ -2178,7 +2178,7 @@ def __init__( :paramtype management_project_number: str """ super().__init__(**kwargs) - self.organization_membership_type = "Member" # type: str + self.organization_membership_type: str = "Member" self.parent_hierarchy_id = parent_hierarchy_id self.management_project_number = management_project_number @@ -2234,7 +2234,7 @@ def __init__( :paramtype workload_identity_provider_id: str """ super().__init__(**kwargs) - self.organization_membership_type = "Organization" # type: str + self.organization_membership_type: str = "Organization" self.excluded_project_numbers = excluded_project_numbers self.service_account_email_address = service_account_email_address self.workload_identity_provider_id = workload_identity_provider_id @@ -2317,7 +2317,7 @@ def __init__( :paramtype project_details: ~azure.mgmt.security.v2022_08_01_preview.models.GcpProjectDetails """ super().__init__(**kwargs) - self.environment_type = "GcpProject" # type: str + self.environment_type: str = "GcpProject" self.organizational_data = organizational_data self.project_details = project_details @@ -2344,7 +2344,7 @@ class GithubScopeEnvironmentData(EnvironmentData): def __init__(self, **kwargs): """ """ super().__init__(**kwargs) - self.environment_type = "GithubScope" # type: str + self.environment_type: str = "GithubScope" class InformationProtectionAwsOffering(CloudOffering): @@ -2394,7 +2394,7 @@ def __init__( ~azure.mgmt.security.v2022_08_01_preview.models.InformationProtectionAwsOfferingInformationProtection """ super().__init__(**kwargs) - self.offering_type = "InformationProtectionAws" # type: str + self.offering_type: str = "InformationProtectionAws" self.information_protection = information_protection diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/operations/__init__.py index 4660a96abf0f..8e4ac6c4f04e 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/operations/__init__.py @@ -9,7 +9,7 @@ from ._security_connectors_operations import SecurityConnectorsOperations from ._patch import __all__ as _patch_all -from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/operations/_security_connectors_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/operations/_security_connectors_operations.py index 908cc9cbd6fd..521a26854bf6 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/operations/_security_connectors_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/operations/_security_connectors_operations.py @@ -45,9 +45,9 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,9 +73,9 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -109,9 +109,9 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -129,7 +129,7 @@ def build_get_request( "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,10 +146,10 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -167,7 +167,7 @@ def build_create_or_update_request( "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -186,10 +186,10 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -207,7 +207,7 @@ def build_update_request( "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -226,9 +226,9 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] + ) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -246,7 +246,7 @@ def build_delete_request( "securityConnectorName": _SERIALIZER.url("security_connector_name", security_connector_name, "str"), } - _url = _format_url_section(_url, **path_format_arguments) + _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -290,10 +290,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.SecurityConnector"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnectorsList] + ) + cls: ClsType[_models.SecurityConnectorsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -314,7 +314,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -330,7 +330,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -338,13 +338,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityConnectorsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -357,7 +357,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors"} @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.SecurityConnector"]: @@ -376,10 +376,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnectorsList] + ) + cls: ClsType[_models.SecurityConnectorsList] = kwargs.pop("cls", None) error_map = { 401: ClientAuthenticationError, @@ -401,7 +401,7 @@ def prepare_request(next_link=None): params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) else: # make call to next link with the client's api-version @@ -417,7 +417,7 @@ def prepare_request(next_link=None): "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) request.method = "GET" return request @@ -425,13 +425,13 @@ def extract_data(pipeline_response): deserialized = self._deserialize("SecurityConnectorsList", pipeline_response) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -444,7 +444,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors"} # type: ignore + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors" + } @distributed_trace def get(self, resource_group_name: str, security_connector_name: str, **kwargs: Any) -> _models.SecurityConnector: @@ -471,10 +473,10 @@ def get(self, resource_group_name: str, security_connector_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) request = build_get_request( resource_group_name=resource_group_name, @@ -486,9 +488,9 @@ def get(self, resource_group_name: str, security_connector_name: str, **kwargs: params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -505,7 +507,9 @@ def get(self, resource_group_name: str, security_connector_name: str, **kwargs: return deserialized - get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @overload def create_or_update( @@ -604,11 +608,11 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -631,9 +635,9 @@ def create_or_update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -650,11 +654,13 @@ def create_or_update( deserialized = self._deserialize("SecurityConnector", pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return deserialized # type: ignore - create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + create_or_update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @overload def update( @@ -750,11 +756,11 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] - content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] - cls = kwargs.pop("cls", None) # type: ClsType[_models.SecurityConnector] + ) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecurityConnector] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -777,9 +783,9 @@ def update( params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -796,7 +802,9 @@ def update( return deserialized - update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + } @distributed_trace def delete( # pylint: disable=inconsistent-return-statements @@ -825,10 +833,10 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop( + api_version: Literal["2022-08-01-preview"] = kwargs.pop( "api_version", _params.pop("api-version", "2022-08-01-preview") - ) # type: Literal["2022-08-01-preview"] - cls = kwargs.pop("cls", None) # type: ClsType[None] + ) + cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( resource_group_name=resource_group_name, @@ -840,9 +848,9 @@ def delete( # pylint: disable=inconsistent-return-statements params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) # type: ignore + request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) @@ -855,4 +863,6 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"} # type: ignore + delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" + }